2023年3月9日 星期四

Google Analytics初學者入門簡介

Google Analytics是一個免費的網站分析工具,可以幫助你了解你的網站訪客的行為和興趣,以及他們對你的網站有多感興趣。你只需要在你的網站上添加一個代碼片段,就可以開始收集數據了。


Google Analytics的報告分為多個部分,其中包括實時報告、受眾報告、獲取報告、行為報告和轉化報告。通過這些報告,你可以了解你的網站訪客來自哪裡,他們在你的網站上進行了什麼操作,以及他們是否有轉化(比如填寫表單或購買產品)等等。


Google Analytics還提供了多種自定義報告和多種數據可視化工具,讓你可以根據自己的需求創建和定制報告,並且更加直觀和易於理解。

2022年4月24日 星期日

[面試]前端工程師面試問題集

最近在找給前端工程師,發現這個網頁蒐集的題目很齊全,在這裡做個筆記,最後附上出處。


常見問題:

  • 你昨天或這週學習了什麼?
  • 寫程式的哪部份最讓你感到很興奮或是有興趣?
  • 最近有無遇過不容易的技術性問題,又如何解決?
  • 當你開發Web應用程式或網站時,針對UI、安全性、效能、SEO、維護性,以及技術,你考量的點是什麼?

2022年2月23日 星期三

[Proxy]資料蒐集與proxy使用by brightdata

    最近因為工作上的需要,要爬取facebook,instagram之類的社群網站上的資料,但因為常常會遇到被網站方ban ip的問題,以往會使用假帳號取得資料,不過現在這些社群網站在導入AI抓假帳號跟爬蟲之後,假帳號越來越難取得,也越來越快會被ban掉,使得爬蟲的效率越來越低落。

2020年10月19日 星期一

[JS] 你的 JS 該減肥了!5個提升網頁載入速度的技巧

 

1. 優化網頁載入速度

為什麼要加快載入速度

  • 載入速度=使用者體驗
  • 根據Amazon內部統計,慢100ms=營收減少1%
  • SEO

2019年4月18日 星期四

[Laravel]Laravel JWT實現單一登入功能

最近需要實作一項JWT身份驗證的功能,同時在有他人登入時將其他client登出

這邊我使用了一項開源的套件tymondesigns/jwt-auth來實作JWT的部分,
正常使用下的安裝說明作者都有寫清楚,
但是!!文件超爛啊... 
文件跟實際上的套件功能缺失了70%左右,慢慢爬程式碼才發現文件跟程式差很多

接下來說說單一登入的部分


2019年4月8日 星期一

[Laravel]使用migrate時發生錯誤Specified key was too long解決方式

由於Laravel使用的預設資料庫字集是utf8mb4,如果你使用的MySQL版本為 v5.7.7 以上,就不會有這個錯誤。
錯誤訊息類似:
[Illuminate\Database\QueryException]
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table users add unique users_email_unique (email))
[PDOException]
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes

2018年6月25日 星期一

[VirtualBox]在MAC環境下的vm ubuntu裡面掛載共享資料夾

先安裝VirtualBox套件工具包

1. Update system's packages
$ sudo apt-get update 
2. install virtual box guest additions (referenced from here)
$ sudo apt-get install virtualbox-guest-additions-iso
3. Now install guest additional package (Crucial step! People generally miss this which creates an error “Unknown file type “vboxsf”)
$ apt-get install virtualbox-guest-utils
之後在VirtualBox主程式裡面設定掛載的資料夾名稱,設定->共用資料夾->加入新的共用資料夾。

現在就可以進行掛載,掛載語法為:
$ mount -t vboxsf shared /home/shared_folder;

2018年1月10日 星期三

[linux]iTerm2顏色配置

$ vim ~/.bash_profile

輸入以下內容

# enables color in the terminal bash shell
export CLICOLOR=1
# sets up the color scheme for list
export LSCOLORS=ExFxCxDxBxegedabagacad
# enables color for iTerm
export TERM=xterm-color
export TERM="xterm-color"
PS1='\[\e[0;33m\]\u\[\e[0m\]@\[\e[0;32m\]\h\[\e[0m\]:\[\e[0;34m\]\w\[\e[0m\]\$ '
# sets up proper alias commands when called
alias ls='ls -vG'
alias ll='ls -al'
alias la='ls -a'
alias vi='vim'

2017年7月13日 星期四

[Python]自然語言相關套件紀錄

自然語言處理 NLTK

這個庫的名字是 Natural Language Toolkit(自然語言工具)的縮寫。正如其名,它被用於由象徵性與統計性自然語言處理的一般任務。NLTK 旨在用於自然語言處理的教學與研究等的相關領域(語義學,認知人工智能科學,等等)並現在它的使用受到了很大的關注。
NLTK 在功能上允許很多操作,例如文字標籤,歸類,標記解釋,名稱識別;通過建立語料樹(corpus tree)來解釋句子的內外聯繫,詞根提取以及語義推理。所有這些內置模塊都允許為不同的任務建造複雜研究系統。

2017年6月23日 星期五

[Python]使用matplotlib在osx上出現的問題

今天在osx上使用到matplotlib的時候遇到了以下錯誤,
RuntimeError: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework. See the Python documentation for more information on installing Python as a framework on Mac OS X. Please either reinstall Python as a framework, or try one of the other backends. If you are using (Ana)Conda please install python.app and replace the use of 'python' with 'pythonw'. See 'Working with Matplotlib on OSX' in the Matplotlib FAQ for more information.

2017年4月27日 星期四

[Apache]Apache access log 分析指令

取得前十名 access 最多的 IP 位址

cat access_log|awk '{print $1}'|sort|uniq -c|sort -nr|head -10



 

取得前十名 access 最多的網頁
cat access_log|awk '{print $11}'|sort|uniq -c|sort -nr|head -10

 

2017年3月15日 星期三

[ES6] import時大括弧的使用方式


This is a default import:
// B.js
import A from './A'
It only works if A contains a default export:
// A.js
export default 42
In this case it doesn’t matter what name you assign to it when importing:

2017年1月20日 星期五

[PHP]Laravel 5.4新特性

Laravel 5.3才剛更新到產品上沒多久就出5.4了Orz...要逼死誰啊XD 但是許多的新特性的確不錯,來紀錄一下新特性的內容吧!


1. Includes Two New Middleware

新增兩個Middleware分別是TrimStrings與ConvertEmptyStringsToNull,TrimStrings的功能是把進來的Request裡面的內容自動做trim的動作,避免使用者多塞空格進來,ConvertEmptyStringsToNull則是當Request裡面的內容是""空字串的話,會自動轉成NULL方便內容判斷,例如:
<input type="text" name="vat" value="">
套用前
dd(request('vat')); // ''
套用後
dd(request('vat')); // null

2016年12月22日 星期四

[ES6] Javascript 開發者必須知道的 10 個新功能

1- Default Parameters

當傳入 function 的參數沒有給值時,防止 expection 出現的方法是設定預設值,es6 比起 es5 的使用方法更快:
var link = function(height = 50, color = ‘red’, url = ‘http://azat.co') { … }

2- Template Literals

在字串 (string) 內嵌入變數時,ES5 必須把字串拆散,把變數通過 + 操作加入字串; ES6 容許通過語法 ${val} 嵌入到字串中:
// es5
// var name = ‘Your name is ‘ + first + ‘ ‘ + last + ‘.’
var name = `Your name is ${first} ${last}.`

2016年9月16日 星期五

[php] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP 錯誤

當執行php程式的時候,error訊息會出現

PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP

這是因為在PHP之後不允許使用class與function使用一樣的名字,一律統一使用建構子
__construct,將class內的function修正後即可繼續正常執行
__construct

2016年8月17日 星期三

[docker]使用docker建立laravel應用環境

 最近在研究跟測試docker建立產品環境給laravel使用,一開始也是當作一般的vm在用,抓回來之後使用完打包重新commit image,但是官方建議使用建立Dockerfile的方式來做這件事情,所以改成使用Dockerfile來處理,紀錄一下設定檔案


[docker]使用docker建立laravel應用環境

 最近在研究跟測試docker建立產品環境給laravel使用,一開始也是當作一般的vm在用,抓回來之後使用完打包重新commit image,但是官方建議使用建立Dockerfile的方式來做這件事情,所以改成使用Dockerfile來處理,紀錄一下設定檔案


2016年6月6日 星期一

[pycon]pycon 2016 day 3 小整理 from 共筆

關於Django & Twisted

  • Scaling Django Application

    Django server only response one request a time
    concurrent request = thread x pools
    Higher scale means higher complexity
    有沒有更好的方法去容納更多的 request ?
    CPU-bound: 數學運算、資料運算等
    IO-bound: Database requests, web requests, other network IO
    ex. 跟資料庫溝通獲取某些資訊

[pycon]pycon 2016 day 2 小整理 from 共筆

關於迪士尼動畫使用的技術

  • Even if we do things in C++, we always make python binding with SWIG or CFFI.
  • Easier to do unit test in Python than C++.
  • All animations are handcrafted.
  • We want xxxxx! Python has a library doing that.
  • Scripting language is not just about syntax and grammar, it’s libraries that matter.
  • Disney’s Hyperion Renderer
  • Early response is important.
  • Disney’s Open Source
  • Free software is free as in puppy. It is free, but you have feed it, etc. You have a lot of responsibility. It is not “free”.
  • Disney’s Github
  • Disney’s Talk
  • Speaker’s Mail

Google Analytics初學者入門簡介