Skip to content

Instantly share code, notes, and snippets.

View jinahadam's full-sized avatar
😲

Jinah Adam jinahadam

😲
View GitHub Profile
[outputLanguages enumerateKeysAndObjectsUsingBlock:^(id key, id object, BOOL *stop) {
NSLog(@"%@ = %@", key, object);
}];
@jinahadam
jinahadam / CallCenter
Created October 15, 2010 02:37
Call Center Setup
CTCallCenter *callCenter;
BOOL callHandlerSetup = NO;
// Setup Call Center
if (callHandlerSetup == NO) {
callCenter = [[CTCallCenter alloc] init];
callCenter.callEventHandler = ^(CTCall *call) {
//Call this function when there is an incoming call
// the incoming call state is in call.callState (NSString)
@jinahadam
jinahadam / haveeru
Created December 23, 2010 12:25
php haveeru scrap
<html>
<head>
<style>
div {
font-family:"A_Randhoo";
direction: rtl;
unicode-bidi: bidi-override;
}
h2 {
font-family:"A_Randhoo";
@jinahadam
jinahadam / NSString Reverse
Created February 9, 2011 02:21
Category Function to reverse NSString
@interface NSString (reverse)
-(NSString *) reverseString;
@end
@implementation NSString (reverse)
-(NSString *) reverseString
#!/bin/sh
# build_fat.sh
#
# Created by Robert Carlsen on 15.07.2009. Updated 24.9.2010.
# Added armv7 into Universal Binary, and updated to 4.3 SDK 26.3.2011.
#
# build an arm / i386 lib of standard linux project
#
# initially configured for tesseract-ocr v2.0.4
# updated for tesseract prerelease v3
@jinahadam
jinahadam / gist:938455
Created April 23, 2011 07:56
timeBetweenTime
get_h: function(timeString) {
var seperator = timeString.indexOf(":");
return this.timeTrim(timeString.substring(0,seperator));
},
get_m: function(timeString) {
var seperator = timeString.indexOf(":");
var timeMinusHour = timeString.substring(seperator);
var theWhiteSpace = timeMinusHour.indexOf(" ");
return this.timeTrim(timeMinusHour.substring(1,theWhiteSpace));
@jinahadam
jinahadam / example.js
Created May 17, 2011 16:50 — forked from madrobby/README.md
Luhn10 algorithm
var validCreditCard = function(a,b,c,d,e){b=a.length-1,e=0,d=~~a[b];while(b--){e++,c=~~a[b],d+=e%2?[0,2,4,6,8,1,3,5,7,9][c]:c};return(d%10==0)};
validCreditCard('378282246310005'); //=> true
validCreditCard('378282246310006'); //=> false
/*
VALID TEST NUMBERS
378282246310005 371449635398431 378734493671000
30569309025904 38520000023237 6011111111111117
# Add this to your .oh-my-zsh theme if you're using those, or directly to your zsh theme :)
# Colors vary depending on time lapsed.
ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT="%{$fg[green]%}"
ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM="%{$fg[yellow]%}"
ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG="%{$fg[red]%}"
ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[cyan]%}"
#Customized git status, oh-my-zsh currently does not allow render dirty status before branch
git_custom_status() {
@jinahadam
jinahadam / gist:5558976
Created May 11, 2013 05:12
dot zshrc file
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
@jinahadam
jinahadam / user-keymap
Created May 15, 2013 03:02
multipane thing for sublime text 2
[
{
"keys": ["super+alt+left"],
"command": "set_layout",
"args":
{
"cols": [0.0, 0.2, 1.0],
"rows": [0.0, 1.0],
"cells": [[0, 0, 1, 1], [1, 0, 2, 1]]
}