Skip to content

Instantly share code, notes, and snippets.

@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@albertodebortoli
albertodebortoli / bookCoverOpen.m
Created March 9, 2012 21:50
Book cover flip animation on iOS (Path app style)
#import <QuartzCore/QuartzCore.h>
UIImageView *splashView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0, 320, 480)];
splashView.image = [UIImage imageNamed:@"Default.png"];
[self.window addSubview:splashView];
[self.window bringSubviewToFront:splashView];
splashView.layer.anchorPoint=CGPointMake(0, .5);
splashView.center = CGPointMake(splashView.center.x - splashView.bounds.size.width/2.0f, splashView.center.y);
[UIView beginAnimations:nil context:nil];
@yesmeck
yesmeck / git-flow.md
Created December 9, 2012 14:53
Git 开发流程

Git 协作流程

master 分支

master 永远处于稳定状态,这个分支代码可以随时用来部署。不允许在该分支直接提交代码。

develop 分支

开发分支,包含了项目最新的功能和代码,所有开发都在 develop 上进行。一般情况下小的修改直接在这个分支上提交代码。

@dergachev
dergachev / GIF-Screencast-OSX.md
Last active June 5, 2024 22:16
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@bryanchriswhite
bryanchriswhite / jshintrc
Created March 15, 2013 17:30
Angular project's .jshintrc file for use with grunt and the jshint plugin.
{
"node" : true,
"browser" : true,
"es5" : true,
"esnext" : true,
"bitwise" : true,
"camelcase": true,
"curly" : true,
"eqeqeq" : true,
"immed" : true,
@manute
manute / gist:5451435
Last active October 25, 2023 19:28
my zsh config with oh-my-zsh
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
#JAVA_HOME
export JAVA_HOME=`/usr/libexec/java_home -v 1.7`
#MAVEN
export M2_HOME=/usr/local/maven-3.0.5
export MAVEN_OPTS=-Xmx1024m
@bgrins
bgrins / detectDataURL.js
Last active December 18, 2023 18:57
Detect if a string is a data URL. Doesn't try to parse it or determine validity, just a quick check if a string appears to be a data URL. See http://jsfiddle.net/bgrins/aZWTB/ for a demo.
// Detecting data URLs
// data URI - MDN https://developer.mozilla.org/en-US/docs/data_URIs
// The "data" URL scheme: http://tools.ietf.org/html/rfc2397
// Valid URL Characters: http://tools.ietf.org/html/rfc2396#section2
function isDataURL(s) {
return !!s.match(isDataURL.regex);
}
isDataURL.regex = /^\s*data:([a-z]+\/[a-z]+(;[a-z\-]+\=[a-z\-]+)?)?(;base64)?,[a-z0-9\!\$\&\'\,\(\)\*\+\,\;\=\-\.\_\~\:\@\/\?\%\s]*\s*$/i;
@kukat
kukat / xcode.rb
Last active September 13, 2016 07:18 — forked from derencius/xcode.rb
aria2 downloader
require 'rubygems'
require 'mechanize'
if ARGV.size < 3
puts %q{Usage: ruby xcode.rb USERNAME PASSWORD "DOWNLOAD_URL" [WGET_PARAMS]}
puts %q{Example: ruby xcode.rb myusername@apple.com 123456 "https://developer.apple.com/devcenter/download.action?path=/Developer_Tools/xcode_4_and_ios_sdk_4.3__final/xcode_4_and_ios_sdk_4.3__final.dmg" }
exit
end
a = Mechanize.new { |agent|
@wintercn
wintercn / template.html
Created September 29, 2013 14:52
一个简单的dom型模板示例
<div>
<a href="{{protocol}}//{{host}}{{pathname}}">{{protocol}}//{{host}}{{pathname}}</a>
</div>
<script>
function Template(node) {
var prototype = document.createDocumentFragment();
prototype.appendChild(node);
@CMCDragonkai
CMCDragonkai / AsyncAnchor.Directive.js
Last active December 31, 2015 22:49
JS: AngularJS Asynchronous Anchor Scroll - There are 3 ways of doing hash scrolling in AngularJS, put a hash into the URL via links, put a hash onto the URL via the $location API, or using $anchorScroll. All three ways rely on the URL having the hash component. The problem comes when the resource you want to scroll is loaded asynchronously, that…
app.directive('asyncAnchor', [
'$location',
'$anchorScroll',
'$timeout',
function($location, $anchorScroll, $timeout){
return {
link: function(scope, element, attributes){
var id = attributes.asyncAnchor || attributes.id || attributes.name;
var delay = attributes.asyncAnchorDelay;