Skip to content

Instantly share code, notes, and snippets.

View clvrobj's full-sized avatar

Chi Zhang clvrobj

  • Singapore, Singapore
View GitHub Profile
@clvrobj
clvrobj / ggifr.js
Last active July 24, 2018 17:45
ggifr.js
var a = document.createElement("IFRAME".toString());
a.src = "https://www.smaato.com/unknown";
a.width = "0";
a.height = "0";
document.body.appendChild(a);

Keybase proof

I hereby claim:

  • I am clvrobj on github.
  • I am mx (https://keybase.io/mx) on keybase.
  • I have a public key whose fingerprint is E2AF 2168 7405 2351 52D1 C908 0DA1 323C F07F 509E

To claim this, I am signing this object:

@clvrobj
clvrobj / tmux-cheatsheet.markdown
Created May 20, 2016 08:24 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
mContext.registerReceiver(
new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
synchronized(mMethodMap) {
resetStateIfCurrentLocaleChangedLocked();
}
}
}, filter);
#!/bin/sh -xe
# Sets up m2crypto on ubuntu architecture in virtualenv
# openssl 1.0 does not have sslv2, which is not disabled in m2crypto
# therefore this workaround is required
PATCH="
--- SWIG/_ssl.i 2011-01-15 20:10:06.000000000 +0100
+++ SWIG/_ssl.i 2012-06-17 17:39:05.292769292 +0200
@@ -48,8 +48,10 @@
@clvrobj
clvrobj / emacs24.el
Created October 11, 2013 02:37
My Emacs config
(menu-bar-mode 0)
(tool-bar-mode 0)
;; (scroll-bar-mode 0)
(blink-cursor-mode 0)
(set-default-font "Source Code Pro 13")
;; format title bar to show full path of current file
(setq-default frame-title-format
(list '((buffer-file-name " %f"
(defun switch-same-buffer-other-window()
"Open same buffer and switch to the other window."
(interactive)
(let ((cur-buf (current-buffer)))
(other-window 1)
(switch-to-buffer cur-buf)))
(global-set-key "\C-x\C-o" 'switch-same-buffer-other-window)
@clvrobj
clvrobj / readme.md
Created January 7, 2013 08:18 — forked from liluo/readme.md

init

mkdir proj
cd proj
git init

config

git config user.name 'username'
@clvrobj
clvrobj / douban.com.js
Created December 15, 2012 13:59
for the coming annoying douban's new nav bar
$('.nav').css({'margin-bottom':'30px'});
$('.nav-primary').css({'padding':0});
$('.nav-logo a').attr('href', 'http://www.douban.com/update/');
$('.nav-logo').css({'height':'52px'});
$('#db-nav-sns .nav-items ul').append('<li><a href="http://www.douban.com/group/">小组</a></li>');
@clvrobj
clvrobj / gist:4167644
Created November 29, 2012 08:46 — forked from rails/gist:58761
var DateHelper = {
// Takes the format of "Jan 15, 2007 15:45:00 GMT" and converts it to a relative time
// Ruby strftime: %b %d, %Y %H:%M:%S GMT
time_ago_in_words_with_parsing: function(from) {
var date = new Date;
date.setTime(Date.parse(from));
return this.time_ago_in_words(date);
},
time_ago_in_words: function(from) {