This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
insert into questions(article, name, email, text, hash, sale_location_id, created_at, updated_at ) select 1111111 as article, 'drew' as name, '[email protected]' as email, md5(generate_series(1,10)::text) as text, md5(generate_series(1,10)::text) as hash, 'shop_r002' as sale_location_id, to_date(now()::text, 'YYYY-MM-DD HH:MI:SS') as created_at, to_date(now()::text, 'YYYY-MM-DD HH:MI:SS') as updated_at; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package singleton | |
import ( | |
"sync" | |
) | |
//http://marcio.io/2015/07/singleton-pattern-in-go/ | |
type singleton struct { | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type FFiltersController struct { | |
Request *http.Request | |
Response http.ResponseWriter | |
} | |
type inputRequest struct { | |
Id int `json:"id"` | |
Url string `json:"url"` | |
SaleLocationId string `json:"sale_location_id"` | |
Categories []string `json:"categories"` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'{"url":"/lg-active3D-smart-tv"}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
............ | |
//another config placed in conf/prod/app.conf | |
func Init() { //old init() | |
//something like init database | |
} | |
func main() { | |
if beego.RunMode == "dev" { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export GOPATH=`pwd` | |
export PATH="$PATH:$GOPATH/bin" | |
echo -e "\033[0;32m CURRENT GOPATH IS: $GOPATH \e[0m" | |
alias rp='source ~/.zshrc' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
siege -c15 -r2 'http://localhost:8000/api/v1/user_channel.get_sale_location POST {"session_id":"8888888888888", "channel":"MM", "sale_location_id":"shop"}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define("XHPROF_ROOT", '/var/www/xhprof-0.9.4'); | |
App::before(function(){ | |
xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY); | |
}); | |
App::after(function(){ | |
require_once (XHPROF_ROOT . '/xhprof_lib/utils/xhprof_lib.php'); | |
require_once (XHPROF_ROOT . '/xhprof_lib/utils/xhprof_runs.php'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$file = file($usersFile->getPathname()); | |
$header = str_getcsv(array_shift($file)); | |
$usersArray = array_map(function ($line) use ($header) { | |
$row = str_getcsv($line); | |
return (object)array_combine($header, $row); | |
}, $file); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo docker run -t -i ubuntu:12.04 | |
>do something | |
Ctrl-p + Ctrl-q | |
sudo docker ps -a | |
sudo docker commit 123432423 andboson/ubuntu:12.04.dev | |
sudo docker images | |
sudo docker run -t -i andboson/ubuntu:12.04.dev /bin/bash | |
>do something | |
Ctrl-p + Ctrl-q | |
sudo docker ps -a |