View horizontal-infinite-carousel.html
View test-clang-format.sh
`brew install clang-format`
`clang-format -h`
`clang-format -i -style=Mozilla InputController.mm`
`clang-format -style=Mozilla -dump-config`
ref: http://tonyarnold.com/2014/05/31/autoformatting-your-code.html
View publisher
#! /usr/bin/python
# -*- coding: utf-8 -*-
import urllib , httplib2
user="xxxx"
password = "xxxxxxx"
body = {'user':user,'password':password}
headers = {'Content-type': 'application/x-www-form-urlencoded'}
View disable-web-security.md

how to disable same origin policy in chrome , for ubuntu users.

vim /usr/share/applications/google-chrome.desktop

Exec=/opt/google/chrome/google-chrome --incognito --disable-web-security

--disable-web-security is the key.

View get_title_and_url.applescript
# Keep in mind that when asking for a `return` after another, only the first one will be output.
# This example is meant as a simple starting point, to show how to get the information in the simplest available way.
# Google Chrome
tell application "Google Chrome" to return URL of active tab of front window
tell application "Google Chrome" to return title of active tab of front window
# Google Chrome Canary
tell application "Google Chrome Canary" to return URL of active tab of front window
tell application "Google Chrome Canary" to return title of active tab of front window
# Chromium
View MagickWand-sucks.md

Wand==0.3.7, Python 3.4.3, OSX EI Capitan 10.11

when run from wand.image import Image it throw errors:

ImportError: MagickWand shared library not found. You probably had not installed ImageMagick library. Try to install: brew install freetype imagemagick

ok, first I try this:

View phantomjs-netsniff.js
if (!Date.prototype.toISOString) {
Date.prototype.toISOString = function () {
function pad(n) { return n < 10 ? '0' + n : n; }
function ms(n) { return n < 10 ? '00'+ n : n < 100 ? '0' + n : n }
return this.getFullYear() + '-' +
pad(this.getMonth() + 1) + '-' +
pad(this.getDate()) + 'T' +
pad(this.getHours()) + ':' +
pad(this.getMinutes()) + ':' +
pad(this.getSeconds()) + '.' +
View vscode.user.setting.json
// Place your settings in this file to overwrite the default settings
{
"workbench.colorTheme": "Monokai Dimmed",
"window.zoomLevel": 1,
"workbench.statusBar.visible": false,
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
View tcp_proxy.js
var net = require('net');
var socket = net.connect({
port: 55555 // ssh -N -D 0.0.0.0:55555 localhost
},function() {
console.log('connected to ssh socks server!');
var server = net.createServer(function(client) {
client.pipe(socket);
});
server.listen(1080, '127.0.0.1');
View Global keyboard hook for OSX
// alterkeys.c
// http://osxbook.com
//
// Complile using the following command line:
// gcc -Wall -o alterkeys alterkeys.c -framework ApplicationServices
//
// You need superuser privileges to create the event tap, unless accessibility
// is enabled. To do so, select the "Enable access for assistive devices"
// checkbox in the Universal Access system preference pane.