Skip to content

Instantly share code, notes, and snippets.

@dingzj
dingzj / install.md
Last active January 3, 2017 05:39
install xgboost python package on mac os x el captian
@dingzj
dingzj / common.min.js
Created September 4, 2015 14:07
qtranslate-x fix for divi theme, save it in admin/js folder
function qtranxj_get_cookie(n) {
for (var e = document.cookie.split(";"), a = 0; a < e.length; ++a) {
var t = e[a],
i = t.split("=");
if (i[0].trim() == n && !(e.length < 2)) return i[1].trim()
}
return ""
}
function qtranxj_ce(n, e, a, t) {
diff -r qtranslate-x/qtranslate_core.php /home/deployer/tmp/qtranslate-x/qtranslate_core.php
12a13
>
499c500
< return trailingslashit(content_url()).$q_config['flag_location'];
---
> return trailingslashit(WP_CONTENT_URL).$q_config['flag_location'];
diff -r qtranslate-x/qtranslate_utils.php /home/deployer/tmp/qtranslate-x/qtranslate_utils.php
219,232c219
< // PATCH for redirection in nginx for rule like location / {try_files $uri /index.php?q=$uri&$args; }
install PostgreSQL 9 in Mac OSX via Homebrew
Mac OS X Snow Leopard
System Version: Mac OS X 10.6.5
Kernel Version: Darwin 10.5.0
Install notes for PostgreSQL 9.0.1 install using Homebrew:
sh-3.2# brew install postgresql
# for more info: https://gist.github.com/1120938
@dingzj
dingzj / deploy-content
Last active May 3, 2017 08:04
content of deploy variable when using custom hook in AWS OpsWorks
before_restart.rb
node[:deploy].each do |application, deploy_item|
run "echo '#{deploy_item.to_json}' >> /tmp/logs.log"
end
## Note only current_path is availabe, no shared_path or release_path
{"home"=>"/home/deploy",
"application_type"=>"rails",
"mounted_at"=>nil,
@dingzj
dingzj / facebook-login.sh
Created June 26, 2012 04:49 — forked from hubgit/facebook-login.sh
Login to Facebook using cURL
#!/bin/bash
# If it redirects to http://www.facebook.com/login.php at the end, wait a few minutes and try again
EMAIL='YOUR_EMAIL' # edit this
PASS='YOUR_PASSWORD' # edit this
COOKIES='cookies.txt'
USER_AGENT='Firefox/3.5'