Skip to content

Instantly share code, notes, and snippets.

@dtrce
dtrce / mp3.js
Created September 8, 2011 18:39
streaming mp3 using nodejs
var http = require('http'),
fileSystem = require('fs'),
path = require('path')
util = require('util');
http.createServer(function(request, response) {
var filePath = 'path_to_file.mp3';
var stat = fileSystem.statSync(filePath);
response.writeHead(200, {

Keybase proof

I hereby claim:

  • I am dtrce on github.
  • I am djavia (https://keybase.io/djavia) on keybase.
  • I have a public key ASBUgdM3Mr5ACCGsbXx5uE2Ux5J8YwjiSRmqhFeqP6T_UAo

To claim this, I am signing this object:

#!/bin/bash
echo "body {-webkit-transform: rotate(1deg); -webkit-filter: blur(1px);}" >> ~/Library/Application\ Support/Google/Chrome/Default/User\ StyleSheets/Custom.css
c() { cd ~/Dropbox/dev/$1; }
_c() { _files -W ~/Dropbox/dev -/; }
compdef _c c
#!/usr/bin/env ruby
require 'rubygems'
require 'aws/s3'
module S3Util
def self.upload_file(local_file)
{
"id"=>"1112",
"vin"=>"5LMFU27535LJ02838",
"year"=>{
"name"=>"2005",
"id"=>"2005"
},
"make"=>{
"name"=>"Lincoln",
"id"=>"28"
@dtrce
dtrce / gist:1279983
Created October 12, 2011 01:38
html div
<div class="clearfix">
<%= label_tag 'customer_email', 'Customer Email' %>
<div class="input">
<%= text_field_tag 'customer_email', nil, :class => 'xlarge' %>
</div>
</div><!-- /customer_email -->
@dtrce
dtrce / app.js
Created September 23, 2011 16:05
nodes with less and mustache
/**
* Module dependencies.
*/
var express = require('express');
var mustache = require("mustache");
var app = module.exports = express.createServer();
@dtrce
dtrce / gist:1219415
Created September 15, 2011 14:40
brew install failed
==> Downloading https://github.com/defunkt/hub/tarball/v1.6.1
File already downloaded in /Users/djavia/Library/Caches/Homebrew
/usr/bin/tar xf /Users/djavia/Library/Caches/Homebrew/hub-1.6.1.tgz
==> rake install prefix=/usr/local/Cellar/hub/1.6.1
rake install prefix=/usr/local/Cellar/hub/1.6.1
==> Exit Status:
http://github.com/mxcl/homebrew/blob/master/Library/Formula/hub.rb#L10
==> Environment
HOMEBREW_VERSION: 0.8
HEAD: a0b940acb775b4affebedea800541f343aac79bf
@dtrce
dtrce / gist:1206477
Created September 9, 2011 15:11
installing cinderella
Cinderella installed successfully
sh: line 25: /usr/bin/cinderella: No such file or directory
Run started Fri Sep 9 11:04:44 EDT 2011
/usr/local/bin/ruby
/usr/local/bin/gem
ERROR: While executing gem ... (Gem::InstallError)
gem "cinderella" is not installed
Building native extensions. This could take a while...
[Version 0.7.3] AMQP connection URI parser now respects port
Building native extensions. This could take a while...