Skip to content

Instantly share code, notes, and snippets.

View jodell's full-sized avatar

Jeffrey ODell jodell

View GitHub Profile
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
void fun(char *str)
{
char buf[1024];
strcpy(buf, str);
}
@jodell
jodell / gist:1878495
Created February 21, 2012 19:55
vim osx installation
# From http://brilliantcorners.org/2011/02/building-vim-on-osx-snow-leopard/
# fetch the source into a vim directory
hg clone https://vim.googlecode.com/hg/ vim
cd vim
# make sure you're up to date
hg pull
hg update
# Uncrustify 0.59
###########################################################################
# nah_xcode_uncrustify.rb default
# configuration
#
# config_version: 1.1.0
#
# Default uncrustify config to use for
# the nah_xcode_uncrustify.rb script
@jodell
jodell / nah_xcode_uncrustify.rb
Created February 20, 2012 04:34 — forked from mnem/nah_xcode_uncrustify.rb
Script file to be run as an Xcode 4 behaviour which uncrustifies the project source using reasonable Objective-C formatting defaults. Alternatively, you can run it and pass a path to uncrustify.
#!/usr/bin/env ruby
###########################################################################
# Script to be called as an Xcode 4 behaviour which will attempt to
# uncrustify all source files in the open project.
#
# (c) Copyright 2012 David Wagner.
#
# Complain/commend: http://noiseandheat.com/
#
#*************************************************************************#
@jodell
jodell / 2px-stroke-line.m
Created February 3, 2012 22:36
2px stroke line
// Draw a 2px stroke line at the bottom of the the view.
- (void)drawRect:(CGRect)rect {
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetStrokeColorWithColor(context, [UIColor whiteColor].CGColor);
CGContextSetLineWidth(context, 2.0);
CGContextMoveToPoint(context, 0, CGRectGetMaxY(rect));
CGContextAddLineToPoint(context, CGRectGetMaxX(rect), CGRectGetMaxY(rect));
CGContextStrokePath(context);
}
@jodell
jodell / gist:1726287
Created February 2, 2012 22:49
UITextFieldView padding
/* Pad a UITextField View */
UIView *paddingView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 10, 20)];
textfield1.leftView = paddingView;
textfield1.leftViewMode = UITextFieldViewModeAlways;
@jodell
jodell / gist:1443544
Created December 7, 2011 16:47
jenkins backup
tar cvzf jenkins.tgz /var/lib/jenkins/ --exclude '/var/lib/jenkins/jobs/*/workspace/*' --exclude '/var/lib/jenkins/jobs/*/bundle/*'
@jodell
jodell / gist:1439002
Created December 6, 2011 17:14
rbenv readline vim
# Care of @timgaleckas
CONFIGURE_OPTS="--with-readline-dir=$(brew --prefix readline)" rbenv install 1.8.7-p352
@jodell
jodell / gist:1387050
Created November 22, 2011 21:32
Chef Server
# Chef Server Setup on Ubuntu/Debian
echo "deb http://apt.opscode.com/ `lsb_release -cs`-0.10 main" | tee /etc/apt/sources.list.d/opscode.list
mkdir -p /etc/apt/trusted.gpg.d
gpg --keyserver keys.gnupg.net --recv-keys 83EF826A
gpg --export [email protected] | tee /etc/apt/trusted.gpg.d/opscode-keyring.gpg > /dev/null
apt-get update
apt-get install opscode-keyring
apt-get upgrade
@jodell
jodell / gist:1387041
Created November 22, 2011 21:30
Chef Server
# Chef Server Setup on Ubuntu/Debian
echo "deb http://apt.opscode.com/ `lsb_release -cs`-0.10 main" | tee /etc/apt/sources.list.d/opscode.list
mkdir -p /etc/apt/trusted.gpg.d
gpg --keyserver keys.gnupg.net --recv-keys 83EF826A
gpg --export [email protected] | tee /etc/apt/trusted.gpg.d/opscode-keyring.gpg > /dev/null
apt-get update
apt-get install -y opscode-keyring
apt-get upgrade -y