View openssl-maker.sh
#!/bin/bash
###############################################################################
## ##
## Build and package OpenSSL static libraries for OSX/iOS ##
## ##
## This script is in the public domain. ##
## Creator : Laurent Etiemble ##
## ##
###############################################################################
View gist:10948618
2014/04/17 01:51:38 go-couchbase: call to ViewCustom("sync_gateway", "channels") in github.com/couchbaselabs/sync_gateway/base.couchbaseBucket.ViewCustom took 207.766195ms
01:51:38.458035 changes_view: Query took 210.170151ms to return 1910 rows, options = db.Body{"stale":false, "startkey":[]interface {}{"339fdb60b42701883337839ce8001c7c", 0x1}, "endkey":[]interface {}{"339fdb60b42701883337839ce8001c7c", 0x62da}}
2014/04/17 01:51:38 go-couchbase: call to ViewCustom("sync_gateway", "channels") in github.com/couchbaselabs/sync_gateway/base.couchbaseBucket.ViewCustom took 209.766802ms
01:51:38.795895 changes_view: Query took 212.639579ms to return 1863 rows, options = db.Body{"stale":false, "startkey":[]interface {}{"aa7634fc7a46e663aad755ed94001420", 0x22e4}, "endkey":[]interface {}{"aa7634fc7a46e663aad755ed94001420", 0x5ef3}}
panic: [object Object] [recovered]
panic: [object Object] [recovered]
panic: [object Object] [recovered]
panic: [object Object] [recovered]
panic: [object Object] [recovered]
panic:
View gist:3031763
<item>
<name>Volumn</name>
<appendix>PageUp to Volume Up</appendix>
<appendix>PageDown to Volume Down</appendix>
<identifier>remap.keytoconsumer_volumn</identifier>
<autogen>--KeyToConsumer-- KeyCode::PAGEUP, ConsumerKeyCode::VOLUME_UP</autogen>
<autogen>--KeyToConsumer-- KeyCode::PAGEDOWN, ConsumerKeyCode::VOLUME_DOWN</autogen>
</item>
View default
# as we’re going to use Unicorn as the application server
# we’re not going to use common sockets
# but Unix sockets for faster communication
upstream shop {
# fail_timeout=0 means we always retry an upstream even if it failed
# to return a good HTTP response (in case the Unicorn master nukes a
# single worker for timing out).
# for UNIX domain socket setups:
server unix:/tmp/shop.socket fail_timeout=0;
View proxy.js
#!/usr/local/bin/node
var sys = require('sys');
var http = require('http');
var url = require('url');
var PREFIX = '/db/';
var TARGET = 'http://example.cloudant.com';
var PORT = 8001;
View .prompt
parse_git_branch() {
RSLT=''
GIT_BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/^* //'`
if [ "$GIT_BRANCH" ]
then
GIT_STATUS=`git status 2> /dev/null | grep 'working directory clean'`
CLR='2'
if [ "$GIT_STATUS" ]
then
CLR='2'
View net-http-debug.rb
BEGIN {
require 'net/http'
Net::HTTP.module_eval do
alias_method '__initialize__', 'initialize'
def initialize(*args,&block)
__initialize__(*args, &block)
View resize image and keep aspect ratio
<style type="text/css">
.thumbImage
{
max-width:150px;
max-height:150px;
}
*html.thumbImage
{
width:expression(this.width>150&&this.width>this.height?150:auto);
View movie file rename
require 'fileutils'
# [chinesename].englishname.garbage.ext => abc - [chinesename].ext
def rename1(path)
files = Dir["#{path}/*"].each {|file|
filename = file.split('/')[-1]
next if filename !~ /^\[/
if filename =~ /(\[.+\]\.?)(.*)(\.[a-z]+)/
chinesename = $1
ext = $3
View iphone network connection status
#import <SystemConfiguration/SCNetworkReachability.h>
#define ReachableViaWiFiNetwork          2
#define ReachableDirectWWAN               (1 << 18)
// fast wi-fi connection
+(BOOL)hasActiveWiFiConnection
{
     SCNetworkReachabilityFlags     flags;
     SCNetworkReachabilityRef     reachabilityRef;
     BOOL                              gotFlags;