This file contains 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
#!/usr/bin/env python | |
import os | |
import sys | |
import hmac | |
import json | |
import time | |
import hashlib | |
import datetime | |
import requests |
This file contains 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
var exec = cordova.require('cordova/exec'); | |
exec.setJsToNativeBridgeMode(exec.jsToNativeModes.XHR_OPTIONAL_PAYLOAD); |
This file contains 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
@import Social; | |
@import Accounts; | |
- (void)testWeibo { | |
BOOL isWeiboAvailable = [SLComposeViewController isAvailableForServiceType:SLServiceTypeSinaWeibo]; | |
NSLog(@"isWeiboAvailable:%d", isWeiboAvailable); | |
if (isWeiboAvailable) { | |
This file contains 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
var protocol = document.location.protocol === 'https:' ? 'https:' : 'http:'; | |
var ds = document.createElement('script'); | |
ds.type = 'text/javascript'; | |
ds.async = true; | |
ds.src = protocol + '//static.duoshuo.com/embed.js'; | |
document.getElementsByTagName('head')[0].appendChild(ds); | |
module.exports = function(cb) { |
This file contains 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
import time | |
j = range(100000) | |
def test_plus(): | |
out = '' | |
for i in j: | |
out += 'a' | |
return out |
This file contains 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
# coding: utf-8 | |
import mistune | |
text = '''hello world | |
* list item 1 | |
* list item 2 | |
here is a [link](http://lepture.com/) |
This file contains 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
#!/bin/bash | |
BIN=/Applications/Xcode.app/Contents/Developer/Tools/ | |
DeRez=$BIN/DeRez | |
Rez=$BIN/Rez | |
iconify() { | |
ICON="$1"; FOLDER="$2" | |
if [[ -f $ICON && -d $FOLDER ]]; then | |
TMP_DIR=$(mktemp -d -t iconify) |
This file contains 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
# coding: utf-8 | |
from flask import Flask | |
from werkzeug.wsgi import pop_path_info, peek_path_info | |
from werkzeug.serving import run_simple | |
app = Flask(__name__) | |
class PathDispatcher(object): |
This file contains 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
function random(obj) { | |
var keys = Object.keys(obj) | |
var choice = keys[Math.floor(Math.random() * (keys.length + 1))]; | |
return obj[choice] | |
} |
This file contains 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
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: supervisord | |
# Required-Start: $remote_fs | |
# Required-Stop: $remote_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Example initscript | |
# Description: This file should be used to construct scripts to be | |
# placed in /etc/init.d. |