Skip to content

Instantly share code, notes, and snippets.

View sukima's full-sized avatar

Devin Weaver sukima

View GitHub Profile
@sukima
sukima / inspect-fomula.bash
Last active August 29, 2015 14:03
Printout the title and URL of all formulas in Homebrew
#!/bin/bash
for p in *.rb; do
URL=$(
cat $p |
grep 'homepage' |
awk '{print $2}' |
sed -e "s/[\"']//g"
)
TITLE=$(
" CTRLP
" http://github.com/kien/ctrlp.vim
" Allow ctrl-p to use git ls-files (better) with fallback
let g:ctrlp_open_new_file = 't'
let g:ctrlp_user_command = {
\ 'types': {
\ 1: ['.git', 'cd %s && git ls-files'],
\ 2: ['.hg', 'hg --cwd %s locate -I .'],
\ }
@sukima
sukima / app.js
Last active August 29, 2015 14:04
Titanium 3.3.0 TableViewRow "blanking" bug example
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
var TestApp = (function() {
function TestApp() {
var _this = this;
this.mainWin = Ti.UI.createWindow({
title: 'Foobar1'
});
<!doctype html>
<html lang="en">
<head>
<title></title>
<meta charset="utf-8" />
<!-- <meta name="apple-mobile-web-app-capable" content="yes" /> -->
<!-- <meta name="viewport" content="width=device-width, initial-scale=1" /> -->
<meta name="viewport" content="width=1024" />
<meta name="description" content="" />
@sukima
sukima / gulpfile.js
Last active August 29, 2015 14:05
Override strings in a string.xml file
var fs = require('fs');
var gulp = require('gulp');
var gutil = require('gulp-util');
var xmlOverride = require('./xml-override');
gulp.task('default', function() {
return gulp.src('data/strings_orig.xml')
.pipe(xmlOverride(fs.readFileSync('data/strings_new.xml', 'utf-8')))
.pipe(gulp.dest('test'));
});
@sukima
sukima / pullquote.coffee
Last active August 29, 2015 14:07
Handlebars helper for pull quotes using Bootstrap 3 classes
Handlebars = require "handlebars"
Handlebars.registerHelper "pullquote", (pull, options) ->
if not options?
options = pull
pull = "right"
quote = ""
saveQuote = (__, quoteText) ->
quote = quoteText.trim()
@sukima
sukima / changes.sh
Last active August 29, 2015 14:08
Update a ChangeLog with random bits
#!/bin/sh
# Update a ChangeLog... with nonsensical gibberish. 'Cause that's how I roll
# usage: changes.sh FILE VERSION
printChanges() {
echo "$2"
echo
dd if=/dev/urandom bs=1 count=64 | base64
echo
var checkStream = function(stream, callback, expectations) {
var results = [];
return stream.on('data', function(chunk) {
results.push(chunk);
})
.once('error', callback)
.once('end', function() {
try {
expectations.call(stream, results);
callback();
var transitions = {
tattleTowerUp: {classname: 'tattleTowerLeft', black: 'borderTopColor', red: 'borderLeftColor'},
tattleTowerLeft: {classname: 'tattleTowerDown', black: 'borderLeftColor', red: 'borderBottomColor'},
tattleTowerDown: {classname: 'tattleTowerRight', black: 'borderBottomColor', red: 'borderRightColor'},
tattleTowerRight: {classname: 'tattleTowerUp', black: 'borderRightColor', red: 'borderTopColor'},
};
function rotateTile(tile) {
Object.keys(transitions).forEach(function(transition) {
var opts = transitions[transition];