Skip to content

Instantly share code, notes, and snippets.

@hoolymama
hoolymama / App.js
Last active March 18, 2024 09:15
Provide runtime environment to app made with create-react-app
import React, { Component } from "react";
import Navigation from "./Navigation";
import withConfig from "./withConfig";
class App extends Component {
componentWillMount() {
console.log(this.props.config);
}
window.resolveLocalFileSystemURL(
imageUri,
function(fileEntry){
newFileName = Math.random().toString(36).substring(7) + "." + imageUri.split('.').pop();
window.resolveLocalFileSystemURL(cordova.file.dataDirectory,
function(dirEntry) {
fileEntry.moveTo(dirEntry, newFileName, successfn, failfn);
},
failfn);
@hoolymama
hoolymama / MayaUpdateKLCommand.py
Created February 4, 2015 02:24
ST3 Plugin to update current file's KL code in Maya
import re, time, sys
import textwrap
from telnetlib import Telnet
import sublime, sublime_plugin
class maya_update_klCommand(sublime_plugin.TextCommand):
'''
ST3 Plugin to update current file's KL code in Maya
This is achieved by preparing and sending python
@hoolymama
hoolymama / itstat_getres.sh
Created July 4, 2013 22:41
process output from itstat (sony)
# "ls *.JPG | itstat" gives the following output:
#
# File: DSCN0159.JPG
# Resolution: 2560 x 1920
# Channels: 10
# Channel Types: RGB with Alpha
# Bit Depth: 8
#
# File: DSCN0160.JPG
@hoolymama
hoolymama / holiday options
Created May 22, 2012 20:40
print date and date + 3 weeks for each week starting june 1st
require 'date'
d = Date.new(2012,6,1)
(0..52).each {|n| puts (d + (n*7)).strftime("%d/%m/%Y") + " "+ (d + ((n+3)*7)).strftime("%d/%m/%Y") }
@hoolymama
hoolymama / replace.sh
Created May 4, 2012 01:28
sed replace overwriting files
for f in `grep -rl darwin64 *`
do
sed 's/darwin64/linux64/g' $f > $f.new
mv $f.new $f
done
for f in `find ./ -name "*.cpp"`; do c=`tail -c 1 $f`; if [ "$c" != "" ]; then echo >> $f ; fi; done
@hoolymama
hoolymama / cli.rb
Created February 18, 2012 17:06
commandline thor generators with invocations
module Flak
class CLI < Thor
register(Generate, 'generate', 'generate <something>', 'Generate a new something.')
end
end
@hoolymama
hoolymama / .bashrc
Created February 2, 2012 16:27
Applescript functions to set up iTerm and start working on a rails project.
alias sequin='cd $DEV/sequin;rvm use 1.9.2-p290@sequin'
@hoolymama
hoolymama / gist:1410680
Created November 30, 2011 20:29
delete all github repos
for r in `cat repoList.txt`
do
dt=`curl -u "my_username:my_password" https://github.com/api/v2/json/repos/delete/hoolymama/$r | cut -d"\"" -f4`
curl -X POST -u "my_username:my_password" -F "delete_token=$dt" https://github.com/api/v2/json/repos/delete/hoolymama/$r
done