Skip to content

Instantly share code, notes, and snippets.

require 'rb-inotify'
BUILD='bundle exec mdpress --latex -s plexus presentation.md'
class WatchTask
def initialize(name, opts = {})
Rake::Task.define_task name do
Array(opts[:watch]).each do |pattern|
notifier.watch(pattern, :modify, :create) do |event|
system(opts[:exec])
Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library /home/arne/.rubies/jruby-1.7.3/lib/native/i386-Linux/libjffi-1.2.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
WARN: The Shoes.setup method is no longer used, you need to install gems yourself.
WARN: To use the 'bluecloth' gem, install it with 'gem install bluecloth --version '=2.0.6'', and put 'require "bluecloth"' at the top of your Shoes program.
WARN: To use the 'metaid' gem, install it with 'gem install metaid ', and put 'require "metaid"' at the top of your Shoes program.
LoadError: no such file to load -- bluecloth
require at org/jruby/RubyKernel.java:1027
require at /home/arne/.rubies/jruby-1.7.3/lib/ruby/shared/rubygems/custom_require.rb:55
(root) at /home/arne/.shoes/red_shoes/dist/samples/simple-rubygems.rb:10
load at org/jruby/RubyKernel.java:1046
source 'https://rubygems.org'
gem 'hexp', path: '/home/arne/github/hexp'
gem 'virtus', github: 'solnic/virtus'
gem 'sinatra'
gem 'active_support'
gem 'debugger'

History

Unix

early 70’s by Bell Labs (AT&T)

first OS not written in assembly (Ken Thompson & Dennis Ritchie)

not commercial (decree from 1956), was licensed with source

1983

I was born

AT&T made Unix commercial

GNU was born

Stallman/FSF

class Note
attr_accessor :message
def initialize(attrs)
@message = attrs[:message]
end
def save
Note.all << self
end
class FizzBuzz
def fizz
loop do
["", "", "Fizz"].each{|s| yield s}
end
end
def buzz
loop do
["", "", "", "", "Buzz"].each{|s| yield s}
eval $s='def quine(t) ; puts "eval $s=#{t}(39.chr+$s+39.chr+%q[ ; quine])" ; end ; ' ; quine(39.chr+$s+39.chr+%q[ ; quine])

Currently pretty much all Rails helpers call tag or content_tag internally to generate tags.

To integrate Hexp with Rails it's possible to override those two methods, and now helpers return syntax tree objects rather than strings.

The main exception are helpers that generate several tags and then join the result.

What I would love to see (I'd happily make a PR) is that helpers use an internal method (e.g. join_tags) that just delegates to Array#join, but that one can override like tag and content_tag.

@plexus
plexus / gist:6280938
Created August 20, 2013 12:50
npm install -g wake
☻ npm install -g wake
npm http GET https://registry.npmjs.org/csso
npm http GET https://registry.npmjs.org/ejs
npm http GET https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/uglify-js
npm http 200 https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz
npm http 200 https://registry.npmjs.org/ejs
npm http GET https://registry.npmjs.org/ejs/-/ejs-0.8.4.tgz
npm http 200 https://registry.npmjs.org/csso
# put in /etc/init/librato.conf and start with 'sudo start librato'
description "collect metrics"
start on (local-filesystems and net-device-up IFACE!=lo)
respawn
env EMAIL=<your email>
env TOKEN=<your librato token>