Skip to content

Instantly share code, notes, and snippets.

View darvin's full-sized avatar

Stefan Novak darvin

View GitHub Profile
@danieljfarrell
danieljfarrell / NSimageToCGColorRef.mm
Created January 26, 2013 10:35
Functions to convert an NSImage (*pattern image*) to a CGColorRef color, following the advice from http://stackoverflow.com/questions/2520978/how-to-tile-the-contents-of-a-calayer
/* http://stackoverflow.com/questions/2520978/how-to-tile-the-contents-of-a-calayer */
// callback for CreateImagePattern.
static void DrawPatternImage (void *info, CGContextRef ctx) {
CGImageRef image = (CGImageRef) info;
CGContextDrawImage(ctx,
CGRectMake(0,0, CGImageGetWidth(image),CGImageGetHeight(image)),
image);
}
@lukewpatterson
lukewpatterson / gist:4242707
Created December 9, 2012 00:24
squeezing private SSH key into .travis.yml file
Tricks to add encrypted private SSH key to .travis.yml file
To encrypt the private SSH key into the "-secure: xxxxx....." lines to place in the .travis.yml file, generate a deploy key then run: (to see what the encrypted data looks like, see an example here: https://github.com/veewee-community/veewee-push/blob/486102e6f508214b04414074c921475e5943f682/.travis.yml#L21
base64 --wrap=0 ~/.ssh/id_rsa > ~/.ssh/id_rsa_base64
ENCRYPTION_FILTER="echo \$(echo \"-\")\$(travis encrypt veewee-community/veewee-push \"\$FILE='\`cat $FILE\`'\" | grep secure:)"
split --bytes=100 --numeric-suffixes --suffix-length=2 --filter="$ENCRYPTION_FILTER" ~/.ssh/id_rsa_base64 id_rsa_
@chrisjacob
chrisjacob / README.md
Created February 14, 2011 14:31
Setup GitHub Pages "gh-pages" branch as a subfolder within the "master" project on your local checkout - a step-by-step guide.

Intro

Setup GitHub Pages "gh-pages" branch as a subfolder within the "master" project on your local checkout.

IMPORTANT

If you plan on switching between different branches (e.g. git checkout master-experiment then revert back with git checkout master) you will loose your child folder from this tutorial (because it's in your .gitignore and is not part of your master branch).

@danielctull
danielctull / gitappledoc
Created December 26, 2010 00:08
A script that uses appledoc by tomaz to generate documentation. Default branches are "develop" for the code and "gh-pages" for the documentation branch (to work with github pages to serve the docs).
#!/bin/bash
codebranch="develop"
docbranch="gh-pages"
projectname=$(pwd | sed "s/^.*\///g")
docdirectory="Documentation"
defaultcommitmessage="Update documentation."
# Switches to the codebranch
# Generates the documentation to /tmp/gitappledoc/
# Switches to the docbranch