Skip to content

Instantly share code, notes, and snippets.

@osuka
osuka / packages.json
Created January 10, 2014 16:42
Have bower automatically launch with npm install. Makes life easier for people just wanting to use your code. Automatically downloads bower, then call 'bower install' after npm install. From http://stackoverflow.com/a/18591690
{
"name": "webapp",
"version": "0.0.0",
"dependencies": {},
"devDependencies": {
"grunt": "~0.4.1",
...
"bower": ""
},
"engines": {
"use strict";
// see http://jshint.com/docs/reporters/
// and https://github.com/jshint/jshint/blob/master/examples/reporter.js
module.exports = {
reporter: function (res) {
var len = res.length;
var str = "";
if (!len) {
@osuka
osuka / Gruntfile.js
Created May 30, 2013 12:55
Sample gruntfile for Firefox OS projects, including testing, code coverage. Requires npm, bower and ruby (for compass)
/*
Needs a configuration file with paths
for Gaia and standalone simulator
File contents for grunt.local.json (config):
{
"b2g_bin_path": "/Applications/B2G.app/Contents/MacOS",
"gaia_homepath": "/Users/OAmat/Documents/code/gaia"
@osuka
osuka / enable-remote-debugging.sh
Created May 30, 2013 12:42
Bash script for setting remote debugging options for Firefox OS
#!/bin/bash
# Defines two properties needs for firefoxOS remote debugging
#
# Usage:
# ./enable-remote-debugging.sh gaia_home
#
# KNOWN BUG:
# If the port is busy it will be ignored and lanuched listening
@osuka
osuka / create-png.sh
Created June 17, 2012 22:06
Create hi-res versions of images with Inkscape and Crop them with Gimp
#!/bin/bash
howmany=`ls *.svg|wc -l`
if [ $howmany -eq 0 ] ; then
echo "Please launch this from inside a folder with svg files."
exit
fi
# In Mac OS X scripting only works when invoked with FULL PATH
@osuka
osuka / gist:1221739
Created September 16, 2011 10:10
Twitter T&C as of august 2011
I. Twitter Content
1. All use of the Twitter API and content, documentation, code, and related materials made available to you on or through Twitter ("Twitter Content") is subject to and must comply with these Rules. As a reminder, you and your Service are subject to the Twitter Terms of Service.
2. You may use the Twitter API and Twitter Content in connection with the products or services you provide (your "Service") to search, display, analyze, retrieve, view, and submit information to or on Twitter. You may use the Twitter name or logos and other brand elements that Twitter makes available in order to identify the source of Twitter Content ("Twitter Marks") subject to these Rules.
3. Your use of the Twitter API and Twitter Content are subject to certain limitations on access, calls, and use as set forth in the Rules, on dev.twitter.com, or as otherwise provided to you by Twitter. If Twitter believes that you have attempted to exceed or circumvent these limitations, your ability to use the Twitter API and
@osuka
osuka / gist:1189374
Created September 2, 2011 18:17
How to add bash git completion on Mac OS X
Download and install an official git from http://git-scm.com/
It already includes the bash completion script.
Add this to your .bash_profile:
source /usr/local/git/contrib/completion/git-completion.bash
PS1='[\u@\h \w$(__git_ps1 " (%s)")]\$ '