Skip to content

Instantly share code, notes, and snippets.

@davidpfahler
davidpfahler / proxy.js
Created April 1, 2014 12:50
Smartlaunch Proxy
var http = require('http'),
httpProxy = require('http-proxy');
process.on('uncaughtException', function(err) {
console.log(err)
@davidpfahler
davidpfahler / bower_issues.md
Last active December 11, 2015 03:38
My problems with twitter/bower

Note: Correct me if I'm wrong. I'd be happy to be wrong here. I want to document the following problems we have using bower:

horizontal dependency installation

bower/bower#157

bower installs dependencies along side each other which makes multiple versions of the same dependency a problem (if not impossible) and also makes the path of a component unpredictable. I want to explain the latter further: When you split a project into multiple components but the main project is still one repository, you can predict the components in this repository will be in ./components/. But when you use this main repository in another project, the dependencies of main project will be installed next to it, not inside its folder.

usage of repos that have no component.json

bower/bower#107

bower/bower#198

coffee:
modules:
files:
src: ["src/**/*.coffee"]
dest: '.'
expand: true
rename: (destBase, destPath) -> destBase + destPath.replace(/\.coffee$/, '.js')
@davidpfahler
davidpfahler / renderer.coffee
Created November 22, 2012 15:36
Renderer draft for Chaplin
define ["chaplin", "underscore"], (Chaplin, _) ->
mediator = Chaplin.mediator
class Renderer
constructor: ->
@initialize arguments...
# list of screens currently in DOM
screens: []
@davidpfahler
davidpfahler / gist:3496388
Created August 28, 2012 09:06
iOS orientation change scale fix
(function(doc) {
var addEvent = 'addEventListener',
type = 'gesturestart',
qsa = 'querySelectorAll',
scales = [1, 1],
meta = qsa in doc ? doc[qsa]('meta[name=viewport]') : [],
fix = function() {
meta.content = 'width=device-width,minimum-scale=' + scales[0] + ',maximum-scale=' + scales[1];
doc.removeEventListener(type, fix, true);
};
@davidpfahler
davidpfahler / gist:3082322
Created July 10, 2012 09:39
Email template to write to DC Council regarding UBER AMENDMENT vote
subject: DC COUNCIL VOTES ON THE UBER AMENDMENT
Dear [Mr/Mrs X],
I would like to ask you to strike down the MINIMUM FARE language from the Uber Amendment. The minimum fare is an attack on start-ups and hinders innovation.  Please tell me what your position in this matter is. The question is: Are you in favor of innovators or incumbents?
Your name and response will be published in a blog of a 1,000,000 + readers.
If you’ll ignore this email, your name will be published as the
DC Council-member who chose to ignore my email.
Thank you for your fastest reply. 
@davidpfahler
davidpfahler / gist:3082309
Created July 10, 2012 09:36
These persons will vote on UBER AMENDMENT today
@marycheh
@cmmichaelabrown
@jimgrahamward1
@jackevansward2
@murielbowser
@kenyanmcduffie
@tommywells
@cmyma
@marionbarryjr
@cataniapress
<?php
function podlove_camelcase_to_snakecase( $string ) {
return preg_replace( '/([a-z])([A-Z])/', '$1_$2', $string );
}
function podlove_camelsnakecase_to_camelcase( $string ) {
return str_replace( '_', '', $string );
}
@davidpfahler
davidpfahler / itc.pl
Created June 22, 2012 20:24 — forked from ninjinkun/itc.pl
Itunes Connect Report Downloader
#!perl
use common::sense;
use HTTP::Request::Common;
use LWP::UserAgent;
use URI;
use Compress::Zlib;
use Perl6::Say;
my $uri = URI->new("https://reportingitc.apple.com/autoingestion.tft");
@davidpfahler
davidpfahler / fetch_finance_reports.rb
Created June 22, 2012 09:01 — forked from lukeredpath/fetch_finance_reports.rb
Fetch iTunes finance reports for your iPhone apps
#!/usr/bin/env ruby
require 'mechanize'
require 'open-uri'
require 'pathname'
require 'fileutils'
require 'pp'
### BEGIN CUSTOMIZATION
# set this to where you would like the reports to be stored