Skip to content

Instantly share code, notes, and snippets.

@deckchairhq
deckchairhq / CakePHP helper for InlineJS (Facebook FBML Tab Page Requirement)
Created January 30, 2010 15:24
CakePHP helper for InlineJS (Facebook FBML Tab Page Requirement)
<?php
class InlinejsHelper extends AppHelper {
var $jsSubFolder = 'fbml';
function renderGeneric() {
$genericScript = 'fbmlgeneric.js';
$genericjs = new File(JS . $this->jsSubFolder . DS . $genericScript);
@deckchairhq
deckchairhq / Gemfile
Created May 20, 2011 13:21
Rails 3.1 Beta -- Working [Heroku Compatible] Gemfile
# source 'http://rubygems.org'
source :gemcutter
gem 'rails', '3.1.0.beta1'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
# Asset template engines
@deckchairhq
deckchairhq / exiftool_stream
Created October 19, 2012 20:12
Pipe in-to and out-of exiftool - no IO latency. Will add to a fork of mini_exiftool gem.
command = "exiftool -a -m -json -"
puts command.inspect
origin = Deckchair::Tempobject.new()
result = Deckchair::Tempobject.new()
origin.write File.read('./test.pdf')
IO.popen(command, 'rb+') do |pipe|
pipe.puts origin.reread
pipe.close_write
@deckchairhq
deckchairhq / Cakefile
Last active December 13, 2015 21:38
Cakefile for compiling and concatenating files and directories of files in order.
# Read more about Cakefiles:
# https://github.com/jashkenas/coffee-script/wiki/[HowTo]-Compiling-and-Setting-Up-Build-Tools
# http://coffeescript.org/documentation/docs/cake.html
# http://coffeescript.org/#cake
fs = require 'fs'
path = require 'path'
coffee_script = require 'coffee-script'
{exec} = require 'child_process'