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
@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
#
@puppybits
puppybits / Behavior Science Terms.md
Last active November 12, 2017 16:38
Behavior Science Terms

anchoring

A cognitive bias that describes the common human tendency to rely too heavily on the first piece of information offered (the "anchor") when making decisions.

asymmetric dominance

The phenomenon whereby consumers will tend to have a specific change in preference between two options when also presented with a third option that is inferior in all respects to one option; but, in comparison to the other option, it is inferior in some respects and superior in others. A higher percentage of consumers will prefer the dominating option than when the asymmetrically dominated option is absent. (starts with a)

choice architecture

@Peeja
Peeja / logged-parser.cljs
Created September 24, 2016 16:28
Om Next parser middleware that adds logging for debugging
(defn logged-parser [parser]
(fn [env query target]
(js/console.groupCollapsed "parser:" (if target (str "(" target ")") ""))
(js/console.trace)
(js/console.debug (with-out-str (pprint query)))
(let [ret (parser env query target)]
(js/console.debug (with-out-str (pprint ret)))
(js/console.groupEnd)
ret)))
@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
@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
@Peeja
Peeja / rerender.cljs
Created September 9, 2016 23:00
What it appears to take to re-render the React tree when Figwheel reloads.
;; Re-render when Figwheel reloads.
(gevents/listen js/document.body
"figwheel.js-reload"
(fn []
(let [root-component (om-next/app-root (compassus/get-reconciler a))]
(letfn [(js-vals [o]
(map #(aget o %) (js-keys o)))
;; Finds the children of a React internal instance of a component.
;; That could be a single _renderedComponent or several
;; _renderedChildren.
@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;
@piotr-yuxuan
piotr-yuxuan / .md
Created August 20, 2020 21:40
Load a standalone Clojure library from a GitHub repository

Download from private GitHub Packages

Add this server in ~/.m2/settings.xml:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <servers>
@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