Skip to content

Instantly share code, notes, and snippets.

@zbyhoo
zbyhoo / solve_pbxproj_merge_conflict.sh
Created May 5, 2011 09:00
Solving pbxproj files git merge conflicts when two users add files at the same time.
#!/bin/sh
projectfile=`find -d . -name 'project.pbxproj'`
projectdir=`echo *.xcodeproj`
projectfile="${projectdir}/project.pbxproj"
tempfile="${projectdir}/project.pbxproj.out"
savefile="${projectdir}/project.pbxproj.mergesave"
cat $projectfile | grep -v "<<<<<<< HEAD" | grep -v "=======" | grep -v "^>>>>>>> " > $tempfile
cp $projectfile $savefile
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@Angles
Angles / Open-source-iOS-apps.md
Created July 25, 2012 19:21
real iOS apps with GitHub open source repos
@nielsbot
nielsbot / CGPathCreateRoundRect.m
Created August 26, 2012 23:47
Function to create a round rect CGPath
CGPathRef CGPathCreateRoundRect( const CGRect r, const CGFloat cornerRadius )
{
CGMutablePathRef p = CGPathCreateMutable() ;
CGPathMoveToPoint( p, NULL, r.origin.x + cornerRadius, r.origin.y ) ;
CGFloat maxX = CGRectGetMaxX( r ) ;
CGFloat maxY = CGRectGetMaxY( r ) ;
CGPathAddArcToPoint( p, NULL, maxX, r.origin.y, maxX, r.origin.y + cornerRadius, cornerRadius ) ;
@border
border / mgoExample.go
Created August 27, 2012 15:33
mgo example
package main
import (
"fmt"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
"time"
)
type Person struct {
@adamgit
adamgit / gist:3705459
Last active December 11, 2023 16:27
Automatically create cross-platform (simulator + device) static libraries for Objective C / iPhone / iPad
##########################################
#
# c.f. http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4
#
# Version 2.82
#
# Latest Change:
# - MORE tweaks to get the iOS 10+ and 9- working
# - Support iOS 10+
# - Corrected typo for iOS 1-10+ (thanks @stuikomma)
@tuttlem
tuttlem / texture.cpp
Created January 5, 2013 07:00
texture class load
SDL_Surface *surface = NULL;
if ((surface = IMG_Load(filename.c_str()))) {
_colours = surface->format->BytesPerPixel;
// get the image format
if (_colours == 4) {
if (surface->format->Rmask == 0x000000ff) {
_format = GL_RGBA;
} else {
@dblooman
dblooman / gist:4555565
Created January 17, 2013 12:17
image
curl http://localhost:3000/?url=m.live.bbc.co.uk/news\&width=320\&userAgent=font-exclude\&delay=2000\ > bbc1L.png
curl http://localhost:3000/?url=http://dave-sandbox.t.proxylocal.com/news\&width=320\&userAgent=font-exclude\&delay=2000\ > bbc1.png
node imagediff [-d|diff] bbc1.png bbc1L.png diff1.png
@sivartydrup
sivartydrup / IOBOT v1.2
Created January 17, 2013 12:23
Next iteration
var Robot = function(robot) {
robot.rotateCannon(90);
};
Robot.prototype.onIdle = function(ev) {
ev.robot.clone();
if (ev.robot.parentId !== null) {
ev.robot.turn(-90);
ev.robot.rotateCannon(3);
anonymous
anonymous / gist:4555828
Created January 17, 2013 13:06
Download Veneer Font Family
Download Veneer Font Family
Veneer from Yellow Design Studio is a high resolution hand-crafted letterpress font that’s vintage and authentic with a touch of grunge. It’s highly customizable with six distress options for every letter and three for all other characters, and because it’s remarkably detailed, it looks great even at very large sizes.
The Veneer family includes Veneer, Veneer Two, and Veneer Three with Veneer containing the least distressed characters and Veneer Three the most. Mix and match as desired to create realistic letterpress type.
Download Link :
http://rapidshare.com/files/2194949428/Veneer.Font.Family.rar