Want to create a Gist from your editor, the command line, or the Services menu? Here's how.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :cowboy do | |
desc 'Deploy without SCM' | |
task :default do | |
deploy_stage = fetch(:stage, 'none') | |
set :repository, "." | |
set :deploy_via, :copy | |
set :scm, :none | |
set :stage, deploy_stage | |
set :cowboy_deploy, true | |
set :copy_exclude, [".git/*", ".svn/*", "log/*", "vendor/bundle/*"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sys = require('sys'), | |
spawn = require('child_process').spawn, | |
http = require('http'); | |
http.createServer(function (req, res) { | |
var ffmpeg = spawn('ffmpeg', ['-i /path/to/file', '-f mp3', '-']); | |
res.writeHead(200, {'Content-Type': 'audio/mpeg'}); | |
ffmpeg.stdout.addListener('data', function (d) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Rack | |
class NoIE | |
def initialize(app, options = {}) | |
@app = app | |
@options = options | |
@options[:redirect] ||= 'http://www.microsoft.com/windows/internet-explorer/default.aspx' | |
@options[:minimum] ||= 7.0 | |
end | |
def call(env) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Temporary middleware for your APIs to immediately support a /v1/some/path.json prefix to | |
# all route calls. | |
# | |
# When you decide to freeze a current API and provide a /v2/ route then | |
# you will cease using this middleware and implement /v1/ and /v2/ routing as appropriate | |
# to your app. | |
# | |
# This middleware provides a placeholder until then so users can be told to use /v1/some/path routes | |
# immediately. | |
# |
NewerOlder