View turn_off_ ConnectHardwareKeyboard.js
const exec = require("child_process").execSync;
const devicePreferences = exec(
`/usr/libexec/PlistBuddy -c "Print :DevicePreferences" ~/Library/Preferences/com.apple.iphonesimulator.plist`
).toString();
const regexp = /\s+([A-Za-z0-9-]+)\s=\sDict\s\{/g;
let matched = [];
while ((matched = regexp.exec(devicePreferences)) !== null) {
const simulatorUuid = matched[1];
try {
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 gmail_feed
#! /usr/bin/python
# -*- coding: utf-8 -*-
#author newdongyuwei@gmail.com
import httplib2
from xml.dom.minidom import parseString
#https://user:password@mail.google.com/mail/feed/atom
gmail_feed_url = "https://mail.google.com/mail/feed/atom"
user="newdongyuwei"
View .slate.js
var leftOneOfThree = slate.operation("push", {
"direction" : "left",
"style" : "bar-resize:screenSizeX/3"
});
var rightTwoOfThree = slate.operation("push", {
"direction" : "right",
"style" : "bar-resize:screenSizeX*2/3"
});
var pushTop = slate.operation("push", {
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 backup_react_native_async_storage.rb
#!/usr/bin/env ruby
# backup workbench.app's AsyncStorage filesystem, so we can restore the whole redux store for development.
require "open3"
Open3.popen3("ps ax | grep workbench.app | awk '{print $5}' ") { |stdin, stdout, stderr|
process_name = stdout.readlines()[0]
base_dir = process_name.split('/data/')[0]
View horizontal-infinite-carousel.html
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 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'}