Skip to content

Instantly share code, notes, and snippets.

View puppybits's full-sized avatar

Bobby puppybits

View GitHub Profile
@puppybits
puppybits / cheeky.sh
Created August 12, 2011 19:28
convert point-and-shoot camera videos (MJPEG w/PCM_U8) to "HD" format (H264 w/ACC MP4)
#!/bin/bash
# @Puppybits circa(2011-05-23)
#FIRST install ffmpeg with the proper plugins then add ffmpeg to profile then convert videos
# sudo port install ffmpeg +gpl +lame +x264 +xvid +faac
# cat ~/.profile echo export #FFMPEG_DATADIR=/opt/local/var/macports/software/ffmpeg/0.6.2_0/opt/local/share/ffmpeg
#usage: ./cheeky.sh ./ ./convertions *.mov
#dir to start search from
@incanus
incanus / Xcode4TestFlightintegration.sh
Created September 1, 2011 19:12
Xcode 4 scheme Archive step Post-script for automatic TestFlight build uploading. See the blog post here: http://developmentseed.org/blog/2011/sep/02/automating-development-uploads-testflight-xcode
#!/bin/bash
#
# (Above line comes out when placing in Xcode scheme)
#
API_TOKEN=<TestFlight API token here>
TEAM_TOKEN=<TestFlight team token here>
SIGNING_IDENTITY="iPhone Distribution: Development Seed"
PROVISIONING_PROFILE="${HOME}/Library/MobileDevice/Provisioning Profiles/MapBox Ad Hoc.mobileprovision"
#LOG="/tmp/testflight.log"
@martijnthe
martijnthe / Xcode4TestFlightintegration.sh
Created November 19, 2011 15:47 — forked from fictorial/Xcode4TestFlightintegration.sh
ReWrite: "Xcode 4 scheme Archive step Post-script for automatic TestFlight build uploading. See the blog post here: http://developmentseed.org/blog/2011/sep/02/automating-development-uploads-testflight-xcode"
#!/bin/bash
#
# (Above line comes out when placing in Xcode scheme)
#
# Inspired by original script by incanus:
# https://gist.github.com/1186990
#
# Rewritten by martijnthe:
# https://gist.github.com/1379127
#
@cristianrasch
cristianrasch / gitlab.sh
Created April 22, 2012 01:50
Install Gitlab on Debian Squeeze/Wheezy
aptitude install -y git curl python-dev python-pip redis-server ruby1.9.1-full rubygems1.9.1
aptitude install -y mysql-server libmysqlclient-dev
adduser --system --shell /bin/sh --gecos 'git version control' --group --disabled-password --home /home/git git
adduser --disabled-login --gecos 'gitlab system' gitlab
usermod -a -G git gitlab
su - gitlab
ssh-keygen -q -N '' -t rsa -f /home/gitlab/.ssh/id_rsa
aptitude install gitolite
cp /home/gitlab/.ssh/id_rsa.pub /home/git/gitlab.pub
su - git
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 2, 2024 05:55
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:

@fupslot
fupslot / gist:5015897
Created February 22, 2013 19:23
Javascript: Convert base64 to a Blob
function dataURItoBlob(dataURI, callback) {
// convert base64 to raw binary data held in a string
// doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this
var byteString = atob(dataURI.split(',')[1]);
// separate out the mime component
var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]
// write the bytes of the string to an ArrayBuffer
var ab = new ArrayBuffer(byteString.length);
@BennettSmith
BennettSmith / ..build-protbuf-2.5.0.md
Last active October 15, 2022 18:41
Script used to build Google Protobuf 2.5.0 for use with Xcode 5 / iOS 7. Builds all supported architectures and produces a universal binary static library.

Google Protobuf 2.5.0 - Mac OS X and iOS Support

The script in this gist will help you buid the Google Protobuf library for use with Mac OS X and iOS. Other methods (such as homebrew or direct compilation) have issues that prevent their use. The libraries built by this script are universal and support all iOS device architectures including the simluator.

Get the Script

The easiest way to use this script is to simply clone the gist onto your

@zmmbreeze
zmmbreeze / stringify.js
Created March 7, 2014 09:13
json stringify can deal with circular reference
// http://stackoverflow.com/questions/11616630/json-stringify-avoid-typeerror-converting-circular-structure-to-json/11616993#11616993
var o = {};
o.o = o;
var cache = [];
JSON.stringify(o, function(key, value) {
if (typeof value === 'object' && value !== null) {
if (cache.indexOf(value) !== -1) {
// Circular reference found, discard key
return;
@ricardopereira
ricardopereira / GradientLayer + Mask + TableView.swift
Last active July 19, 2023 16:59
Apply vertical mask alpha gradient to UITableView
let gradient = CAGradientLayer()
gradient.frame = tableView.superview?.bounds ?? CGRectNull
gradient.colors = [UIColor.clearColor().CGColor, UIColor.clearColor().CGColor, UIColor.blackColor().CGColor, UIColor.blackColor().CGColor, UIColor.clearColor().CGColor, UIColor.clearColor().CGColor]
gradient.locations = [0.0, 0.15, 0.25, 0.75, 0.85, 1.0]
tableView.superview?.layer.mask = gradient
tableView.backgroundColor = UIColor.clearColor()
@swannodette
swannodette / spec.cljs
Last active March 5, 2018 23:24
om.next query spec
(ns om.next.spec
(:require [cljs.spec :as s]))
(s/def ::ident (s/and vector? (s/cat :ident keyword? :value #(not (coll? %)))))
(s/def ::join-key (s/or :prop keyword? :ident ::ident))
(s/def ::join (s/and (s/map-of ::join-key ::query) #(= (count %) 1)))
(s/def ::union (s/and (s/map-of keyword? ::query) #(> (count %) 1)))
(s/def ::param-expr
(s/cat :query-expr ::query-expr