Skip to content

Instantly share code, notes, and snippets.

@phstc
phstc / gtk-firefox.sh
Created November 20, 2012 22:56
INSTALL FIREFOX ON AMAZON LINUX X86_64 COMPILING GTK+
#!/bin/bash
# GTK+ and Firefox for Amazon Linux
# Written by Joseph Lawson 2012-06-03
# http://joekiller.com
# http://joekiller.com/2012/06/03/install-firefox-on-amazon-linux-x86_64-compiling-gtk/
# chmod 755 ./gtk-firefox.sh
# sudo ./gtk-firefox.sh
@phstc
phstc / test-twilio.xml
Created November 16, 2012 17:44
test twilio
<?xml version='1.0' encoding='utf-8' ?>
<Response>
<Dial callerId="+5511965056615">
<Number>+5511965056615</Number>
</Dial>
</Response>
@phstc
phstc / gist:3805437
Created September 29, 2012 23:52
.pryrc
# Pry.config.editor = "mate -w"
Pry.config.editor = "vim"
Pry.config.prompt = proc do |obj, level, _|
prompt = ""
prompt << "#{Rails.version}@" if defined?(Rails)
prompt << "#{RUBY_VERSION}"
"#{prompt} (#{obj})> "
end
@phstc
phstc / gist:3765016
Created September 22, 2012 03:27
.gemrc
---
:verbose: true
:update_sources: true
:backtrace: false
:bulk_threshold: 1000
:benchmark: false
gem: --no-ri --no-rdoc
@phstc
phstc / gist:3765013
Created September 22, 2012 03:25
.irbrc
# Autocomplete
require "irb/completion"
require "rubygems"
require "pp"
# Add all gems installed in the system to the $LOAD_PATH
# so they can be used in Rails console with Bundler
if defined?(::Bundler)
gem_paths = Dir.glob("/usr/local/lib/ruby/gems/1.9.1/gems/**/lib")
gem_paths.each do |path|
@phstc
phstc / Legacy.java
Created July 14, 2012 01:19
Refactoring Legacy Code - Removing strong dependencies
/*
* Legacy code with strong dependency with OrderDAO.
*/
public class OrderDAO {
public boolean delete(int id) {
// ...
}
}
public class OrderService {
@phstc
phstc / node-static-test.js
Created June 30, 2012 03:42
vows test/integration/node-static-test.js --spec
var vows = require('vows')
, request = require('request')
, assert = require('assert')
, static = require('../../lib/node-static');
var fileServer = new(static.Server)(__dirname + '/../fixtures', {});
var suite = vows.describe('file-server.js');
var TEST_PORT = 8080;
class Commenter
constructor: (@author) ->
write: (message) ->
console.log "#{@author}: #{message}"
commenter = new Commenter 'Pablo'
commenter.write 'Hello World'
@phstc
phstc / gist:2800877
Created May 27, 2012 03:20
cat ~/Library/Logs/Homebrew/config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by ImageMagick configure 6.7.5-7, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ ./configure --disable-osx-universal-binary --without-perl --prefix=/usr/local/Cellar/imagemagick/6.7.5-7 --disable-dependency-tracking --enable-shared --disable-static --with-modules --without-gslib --with-gs-font-dir=/usr/local/share/ghostscript/fonts --without-magick-plus-plus
## --------- ##
## Platform. ##
@phstc
phstc / gist:2800859
Created May 27, 2012 03:20
brew --config
HOMEBREW_VERSION: 0.9
HEAD: 49f5f37ca37ee49008fb3aecb7095c29a211de5d
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: dual-core 64-bit penryn
OS X: 10.7.4
Kernel Architecture: x86_64
Xcode: 4.3.2
GCC-4.0: N/A
GCC-4.2: N/A