Skip to content

Instantly share code, notes, and snippets.

View neilang's full-sized avatar
😎
Just being a cool guy

Neil Ang neilang

😎
Just being a cool guy
View GitHub Profile
@neilang
neilang / .profile
Created May 6, 2011 02:20
My bash profile
alias hostname="hostname | cowsay"
alias whoami="whoami | cowsay"
alias pwd="pwd | cowsay"
alias date="date | cowsay"
@neilang
neilang / git config
Created July 20, 2011 06:08
Add git plush command
[alias]
plush = "!sh -c 'git pull --rebase && git push'"
@neilang
neilang / .vimrc
Created August 20, 2011 02:29
my .vimrc
syntax on " Syntax highlight
" set backspace=2
set backspace=indent,eol,start " Fixes backspace on unix systems
set tabstop=2 " set tab width
set shiftwidth=2
set expandtab " spaces instead of tabs
@neilang
neilang / t800.m
Created October 5, 2011 23:01
Idea for macro
#define iNeedYourClothes alloc
#define andYourBoots init
#define hastaLaVistaBaby release
NSObject *obj = [[NSObject iNeedYourClothes] andYourBoots];
// ...
[obj hastaLaVistaBaby];
@neilang
neilang / NASpinSegue.m
Created December 4, 2011 04:01
Spin Segue
#import "NASpinSegue.h"
@implementation NASpinSegue
- (void)perform{
UIViewController *sourceViewController = (UIViewController *)self.sourceViewController;
UIViewController *destinationViewController = (UIViewController *)self.destinationViewController;
@neilang
neilang / NASpinSegue.m
Created December 4, 2011 04:52
Spin Segue using CABasicAnimation
#import "NASpinSegue.h"
#import <QuartzCore/QuartzCore.h>
#define SPINS 3.0f
#define DURATION 0.5f
#define TRANSITION_OUT_KEY @"transition out"
#define TRANSITION_IN_KEY @"transition in"
#define TRANSITION_IDENT @"transition type"
@implementation NASpinSegue
@neilang
neilang / arduino-morse.c
Created May 7, 2012 11:23
Never gonna give you up - morse code
int ledPin = 13;
#define DOT_LENGTH 250
// A dash is equal to three dots
#define DASH_LENGTH (DOT_LENGTH * 3)
// The space between parts of the same letter is equal to one dot
#define PART_PAUSE DOT_LENGTH
// The space between two letters is equal to three dots
#define LETTER_PAUSE ((DOT_LENGTH * 3) - PART_PAUSE)
// The space between two words is equal to seven dots
# RailsAdmin config file. Generated on April 04, 2013 19:54
# See github.com/sferik/rails_admin for more informations
RailsAdmin.config do |config|
################ Global configuration ################
# Set the admin name here (optional second array element will appear in red). For example:
config.main_app_name = ['Issue1591', 'Admin']
#include <stdio.h>
#define assuming if
#define otherwise else
int main(int argc, const char * argv[])
{
int neil, awesome;
neil = awesome = 1;