This file contains hidden or 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
| JAVA_OPTS="${JAVA_OPTS} -Xms1024m -Xmx2048m -XX:MaxPermSize=256m -server"; export JAVA_OPTS; |
This file contains hidden or 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
| 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' |
This file contains hidden or 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
| set mailserver smtp.gmail.com port 587 | |
| username "email@domain.tld" password "password" | |
| using tlsv1 | |
| with timeout 30 seconds |
This file contains hidden or 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 <Cocoa/Cocoa.h> | |
| @interface NSMutableArray (variadicMethodExample) | |
| - (void) appendObjects:(id) firstObject, ...; // This method takes a nil-terminated list of objects. | |
| @end | |
| @implementation NSMutableArray (variadicMethodExample) |
This file contains hidden or 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 <SystemConfiguration/SCNetworkReachability.h> | |
| #define ReachableViaWiFiNetwork 2 | |
| #define ReachableDirectWWAN (1 << 18) | |
| // fast wi-fi connection | |
| +(BOOL)hasActiveWiFiConnection | |
| { | |
| SCNetworkReachabilityFlags flags; | |
| SCNetworkReachabilityRef reachabilityRef; | |
| BOOL gotFlags; |
This file contains hidden or 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
| 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 |
This file contains hidden or 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
| <style type="text/css"> | |
| .thumbImage | |
| { | |
| max-width:150px; | |
| max-height:150px; | |
| } | |
| *html.thumbImage | |
| { | |
| width:expression(this.width>150&&this.width>this.height?150:auto); |
This file contains hidden or 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
| BEGIN { | |
| require 'net/http' | |
| Net::HTTP.module_eval do | |
| alias_method '__initialize__', 'initialize' | |
| def initialize(*args,&block) | |
| __initialize__(*args, &block) |
This file contains hidden or 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
| 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' |
This file contains hidden or 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/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; |