Skip to content

Instantly share code, notes, and snippets.

View saighost's full-sized avatar

saighost saighost

View GitHub Profile
@tehnoir
tehnoir / set_project_profiles.sh
Created April 13, 2016 19:19
Update Xcode project's build settings to point to current provisioning profiles.
#!/bin/bash
##############################################################################################################
### 1. Name your profiles with the convention of ProjectName_TargetName_ConfigurationName.mobileprovision ###
### 2. Create a directory called CodeSign in your project directory ###
### 3. Move all your project's provisioning profiles into the CodeSign directory ###
### ###
### Running this script will update your project file to point to the correct UUIDs of each corresponding ###
### profile in your CodeSign directory. ###
##############################################################################################################
@dongyuwei
dongyuwei / select2clipboard.py
Last active December 24, 2015 13:59
copy sublime text3's current selection into clipboard. Inspired by iterm2's `copy on select` feature.
import sublime, sublime_plugin
class Copy_on_select(sublime_plugin.EventListener):
def on_selection_modified(self, view):
for region in view.sel():
if not region.empty():
print(view.substr(region))
view.run_command('copy')
local Queue = Object:extend()
continuable.Queue = Queue
function Queue:initialize()
self.head = {}
self.tail = {}
self.index = 1
self.headLength = 0
end
@dongyuwei
dongyuwei / weibo_wap.js
Created August 14, 2012 07:45
自动登陆新浪微博移动版( http://m.weibo.cn ) 发微博
var http = require('http');
var qs = require('querystring');
function parse_response(res, callback) {
var list = [];
res.on('data', function(chunk) {
list.push(chunk);
});
res.on('end', function() {
callback(Buffer.concat(list).toString());
@fxsjy
fxsjy / gist:3291755
Last active January 9, 2021 16:12
Memcached in JavaScript based on Node.JS
//author: Sun, Junyi (weibo.com/treapdb)
//usage: node --nouse-idle-notification --expose-gc --max-old-space-size=8192 memcached.js
var config ={
port: 11211,
max_memory: 300 // default 100M bytes
}
var net = require('net');
var LRU = function (max) { // this LRU implementaion is based on https://github.com/chriso/lru
@dongyuwei
dongyuwei / weibo-oauth2.js
Created July 27, 2012 10:19
sina weibo oauth2 api,in nodejs
var https = require('https');
var path = require('path');
var fs = require('fs');
var qs = require('querystring');
var express = require('express');
var multiparter = require("multiparter");
process.on('uncaughtException', function(err) {
console.error('Caught exception: ', err);
});
@wintercn
wintercn / h5g
Last active May 19, 2017 06:50
HTML5 Canvas Game Template
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<!--允许全屏-->
<meta content="yes" name="apple-mobile-web-app-capable"/>
<meta content="yes" name="apple-touch-fullscreen"/>
<!--禁止电话号码和邮箱识别-->