https://github.com/mustache/emacs
In your shell:
cd ~/.emacs.d/vendor
curl -O https://github.com/mustache/emacs/raw/master/mustache-mode.el
In your Emacs config:
(add-to-list 'load-path "~/.emacs.d/vendor/mustache-mode.el")
# stolen from http://github.com/cschneid/irclogger/blob/master/lib/partials.rb | |
# and made a lot more robust by me | |
# this implementation uses erb by default. if you want to use any other template mechanism | |
# then replace `erb` on line 13 and line 17 with `haml` or whatever | |
module Sinatra::Partials | |
def partial(template, *args) | |
template_array = template.to_s.split('/') | |
template = template_array[0..-2].join('/') + "/_#{template_array[-1]}" | |
options = args.last.is_a?(Hash) ? args.pop : {} | |
options.merge!(:layout => false) |
require 'rubygems' | |
require 'sinatra' | |
require 'fileutils' | |
# upload with: | |
# curl -v -F "data=@/path/to/filename" http://localhost:4567/user/filename | |
post '/:name/:filename' do | |
userdir = File.join("files", params[:name]) |
class Company | |
include Mongoid::Document | |
has_many :projects | |
end | |
class Project | |
include Mongoid::Document | |
has_many :project_zones | |
has_many :incidents | |
has_many_related :safety_inspectors |
https://github.com/mustache/emacs
In your shell:
cd ~/.emacs.d/vendor
curl -O https://github.com/mustache/emacs/raw/master/mustache-mode.el
In your Emacs config:
(add-to-list 'load-path "~/.emacs.d/vendor/mustache-mode.el")
In your shell:
cd ~/.vim
git clone git://github.com/juvenn/mustache.vim.git
mv mustache.vim/syntax/* syntax/
mv mustache.vim/indent/* indent/
mv mustache.vim/ftdetect/* ftdetect/
rm -rf mustache.vim
# Author: Pieter Noordhuis | |
# Description: Simple demo to showcase Redis PubSub with EventMachine | |
# | |
# Update 7 Oct 2010: | |
# - This example does *not* appear to work with Chrome >=6.0. Apparently, | |
# the WebSocket protocol implementation in the cramp gem does not work | |
# well with Chrome's (newer) WebSocket implementation. | |
# | |
# Requirements: | |
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby |
if (typeof window.localStorage == 'undefined' || typeof window.sessionStorage == 'undefined') (function () { | |
var Storage = function (type) { | |
function createCookie(name, value, days) { | |
var date, expires; | |
if (days) { | |
date = new Date(); | |
date.setTime(date.getTime()+(days*24*60*60*1000)); | |
expires = "; expires="+date.toGMTString(); |
# from: http://kfahlgren.com/blog/2006/11/01/multipart-post-in-ruby-2/ | |
# edited by makevoid, http://makevoid.com | |
URL = "http://localhost:3000/your_url" | |
TIMEOUT_SECONDS = 10 | |
params = {} | |
file = File.open(filename, "rb") | |
params["file[replay]"] = file |
// loop through the 'paper' variable from Raphael JS and build up the JSON object describing all images and paths within it. | |
buildJSON = function(paper) { | |
var svgdata = []; | |
svgdata.push({ | |
width: 390, | |
height: 400 | |
}); | |
$.each(paper, |
# | |
gem install ruby-debug19 -- --with-ruby-include=/home/belbo/.rvm/src/ruby-1.9.2-head/ |