Skip to content

Instantly share code, notes, and snippets.

@sentientwaffle
sentientwaffle / gist:1056607
Created June 30, 2011 16:32
Rails 3.1.0.rc4 engines
$ rails -v
Rails 3.1.0.rc4
$ rails plugin new my_engine --skip-bundle -O --old-style-hash --full
$ cd my_engine
$ rails g --help
/home/x/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc4/lib/rails/railtie.rb:192:in `load_generators': wrong number of arguments (0 for 1) (ArgumentError)
from /home/x/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc4/lib/rails/generators.rb:331:in `load_generators_from_railties!'
from /home/x/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc4/lib/rails/generators.rb:313:in `lookup!'
from /home/x/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc4/lib/rails/generators.rb:217:in `help'
from /home/x/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc4/lib/rails/commands/generate.rb:7:in `<top (required)>'
-# This renders perfectly.
= bubbl
-# This doesnt render... why?
= bubble
@sentientwaffle
sentientwaffle / server.coffee
Created November 11, 2011 01:46
Trouble w/ browserify and fileify
# ...
browserify = require 'browserify'
fileify = require 'fileify'
# Set up the browserify client bundle.
bundle = browserify
watch: true
bundle.use fileify("templates", "#{__dirname}/../../client/site/projects")
@sentientwaffle
sentientwaffle / stylus_converter.rb
Created February 5, 2012 02:14
Stylus plugin for Jekyll
require 'shellwords'
module Jekyll
class StylusConverter < Converter
safe true
def matches(ext)
ext =~ /\.styl/i
end
@sentientwaffle
sentientwaffle / table_of_contents.rb
Created February 5, 2012 02:17
Table of contents Jekyll plugin
# Be sure to set the following in the `_config.yml`.
#
# markdown: rdiscount
# rdiscount:
# extensions: [generate_toc]
#
module Jekyll
class MarkdownConverter
def convert(content)
setup
@sentientwaffle
sentientwaffle / test.rb
Created February 6, 2012 14:57
CS235 Test runner
require 'term/ansicolor'
include Term::ANSIColor
dir = ARGV[0].gsub /\/$/, ""
def compile(d)
`(cd #{d} && g++ *.cpp)` # -Wall
return $? == 0
end
@sentientwaffle
sentientwaffle / stratus_color.rb
Created February 7, 2012 20:53
Jekyll plugin for syntax highlighting via stratus-color
require 'shellwords'
module Jekyll
class StratusColorBlock < Liquid::Block
def initialize(tag_name, markup, tokens)
super
@lang = markup
end
def render(context)
@sentientwaffle
sentientwaffle / simple-tar.coffee
Created February 9, 2012 17:32
Node.js compress a directory with tar; and write it to a tmp dir.
###
Allow the user to download a file or a directory as a _.tar.gz_
compressed version.
###
fs = require "fs"
{exec} = require "child_process"
{resolve} = require "path"
# `callback` receives `(tarPath)`
@sentientwaffle
sentientwaffle / config.json
Created February 10, 2012 02:42
my Stratus Editor configuration file
{ "fractus.autocomplete": "Control- "
, "file.recent.limit": 0
, "save-on-blur":
[ "CSS"
, "Sass"
, "Stylus"
]
}
@sentientwaffle
sentientwaffle / gist:2040917
Created March 15, 2012 01:05
Error installing hook.io
$ npm install hook.io -g [40/1895]
> mdns@0.0.5 preinstall /home/x/local/lib/node_modules/hook.io/node_modules/mdns
> node-waf clean || true; node-waf configure build
> weak@0.1.5 preinstall /home/x/local/lib/node_modules/hook.io/node_modules/weak
> node build.js
Nothing to clean (project not configured)