Skip to content

Instantly share code, notes, and snippets.

source ~/.bash_profile
hash oclint &> /dev/null
if [ $? -eq 1 ]; then
echo >&2 "oclint not found, analyzing stopped"
exit 1
fi
cd ${TARGET_TEMP_DIR}
@codesburner
codesburner / build.sh
Created October 8, 2012 11:48 — forked from jonah-williams/build.sh
Command line iOS project builds and over-the-air distribution
#!/bin/bash
# https://gist.github.com/949831
# http://blog.carbonfive.com/2011/05/04/automated-ad-hoc-builds-using-xcode-4/
# command line OTA distribution references and examples
# http://nachbaur.com/blog/how-to-automate-your-iphone-app-builds-with-hudson
# http://nachbaur.com/blog/building-ios-apps-for-over-the-air-adhoc-distribution
# http://blog.octo.com/en/automating-over-the-air-deployment-for-iphone/
# http://www.neat.io/posts/2010/10/27/automated-ota-ios-app-distribution.html
@codesburner
codesburner / .gitignore
Created September 28, 2012 12:06 — forked from adamgit/.gitignore
.gitignore file for Xcode4 / OS X Source projects
#########################
# .gitignore file for Xcode4 / OS X Source projects
#
# NB: if you are storing "built" products, this WILL NOT WORK,
# and you should use a different .gitignore (or none at all)
# This file is for SOURCE projects, where there are many extra
# files that we want to exclude
#
# For updates, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#########################
@codesburner
codesburner / logicGates.py
Created April 13, 2012 14:20
Simple Logic gates
def NOT(a):
return (1 - a)
def AND(a,b):
return a * b
def OR(a,b):
return a + b
def NAND(a,b):
@codesburner
codesburner / algorithm.js
Created March 30, 2012 10:29 — forked from killwing/algorithm.js
[algorithm] various algorithm samples
#!/usr/local/bin/node
var assert = require('assert');
// utils
Array.prototype.swap = function(a, b) {
if (a == b) {
return;
}
var tmp = this[a];
@codesburner
codesburner / hash_algo.c
Created March 30, 2012 10:26
hash algorithms
//PHP中出现的字符串Hash函数
static unsigned long hashpjw(char *arKey, unsigned int nKeyLength)
{
unsigned long h = 0, g;
char *arEnd=arKey+nKeyLength;
while (arKey < arEnd)
{
h = (h << 4) + *arKey++;
@codesburner
codesburner / parseAndModifyHtml.js
Created March 1, 2012 12:44 — forked from clarkdave/parseAndModifyHtml.js
Using node.js to parse HTML with jsdom and modify it with jQuery
/**
* npm install jsdom
* npm install jquery
*/
var html = "<!doctype html><html><body><h1>Hello world!</h1></body></html>";
/* parse the html and create a dom window */
var window = require('jsdom').jsdom(html, null, {
// standard options: disable loading other assets
//for hide the status bar
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
//hide the title bar
Display display;
display = ((WindowManager)getSystemService(WINDOW_SERVICE)).getDefaultDisplay();
int height = display.getHeight();
int width = display.getWidth();
try{
File f = new File(Environment.getExternalStorageDirectory()+"/myFile.txt");
fileIS = new FileInputStream(f);
BufferedReader buf = new BufferedReader(new InputStreamReader(fileIS));
String readString = new String();
//just reading each line and pass it on the debugger