Skip to content

Instantly share code, notes, and snippets.

View victusfate's full-sized avatar
🚀

Mark Essel victusfate

🚀
View GitHub Profile
Some brief instructions on how to use Sprocket 2 in Rails to get CoffeeScript
powered JS and SASS powered CSS with YUI compression all via the magic of rack.
This stuff will be native in Rails 3.1 and the layout of the files on the
filesystem will be different but this guide will get you working with it
while we wait for all that to finalize.
Ignore the number prefixes on each file. This is just to ensure proper order in the Gist.
It's based on eric1234 gist https://gist.github.com/911003. ijust made it 3.1 compliant in terms of convention
@victusfate
victusfate / Gemfile
Created May 10, 2011 00:06 — forked from dodeja/Gemfile
Rails 3.1 Beta 1 on Heroku Working Config
# source 'http://rubygems.org'
source :gemcutter
gem 'rails', '3.1.0.beta1'
# Asset template engines
gem 'json'
gem 'sass'
gem 'coffee-script'
gem 'uglifier'
@victusfate
victusfate / y-combinator-generated.js
Created May 6, 2011 12:47
Y-Combinator in CoffeeScript
var Y, factorial;
Y = function(le) {
return (function(f) {
return f(f);
})(function(f) {
return le(function(x) {
return f(f)(x);
});
});
};
@victusfate
victusfate / gist:954137
Created May 3, 2011 20:19 — forked from shripadk/gist:652819
Express authentication using Redis for session store and Couchdb for database (in coffeescript!)
###
Module dependencies
###
require.paths.unshift "#{__dirname}/lib/support/express-csrf/"
require.paths.unshift "#{__dirname}/lib/support/node_hash/lib/"
express = require 'express'
app = module.exports = express.createServer()
RedisStore = require 'connect-redis'
@victusfate
victusfate / Excel.php
Created April 25, 2011 22:04 — forked from ihumanable/Excel.php
Simple Excel Writer in PHP
<?php
/**
* Simple excel writer class with no external dependencies, drop it in and have fun
* @author Matt Nowack
* @license Unlicensed
* @version 1.0
*/
class Excel {
private $col;
require 'rubygems'
require 'json'
require 'redis'
class RedisComments
def initialize(redis,namespace,sort_proc=nil)
@r = redis
@namespace = namespace
@sort_proc = sort_proc
end
javascript: (function () {
var n = null,
C = false;
function h(m) {
d(m, "jsgif_overlaid");
m.removeEventListener("click", i, C)
}
function i(m) {
var o = this;
ruby-1.9.2-p0 > require 'postrank-api'
ruby-1.9.2-p0 > pr = PostRank::API.new('ig')
ruby-1.9.2-p0 > pr.feed(pr.feed_info('igvita.com')['id'], :num => 5)['items'].map {|i| i['content'].gsub(/<\/?[^>]*>/, "").summarize}
[
[0] "The world of concurrent computation is a complicated one. Hence, not surprisingly, when Bruce Tate asked Matz, in an interview for his recent book (Seven Languages in Seven Weeks) for a feature that he would like to change in Ruby if he could go back in time, the answer was telling: \xE2\x80\x9CI would remove the thread and add actors or some other more advanced concurrency features\xE2\x80\x9D.\nProcess Calculi & Advanced Concurrency\nIt is easy to read a lot into Matz's statement, but the follow-up question is: more advanced concurrency features? Process calculi is the formal name for the study of many related approaches of modeling the behavior of concurrent systems, which provides many alternatives: CCS, CSP, ACP, and Actor models just to name a few.\nActors, CSP and Pi-calculus\n
require 'net/http'
require 'uri'
require 'nokogiri'
url = URI.parse('http://webapps.cityofchicago.org/healthinspection/inspectionresultrow.jsp')
request = Net::HTTP::Post.new(url.path)
request.set_form_data({"REST"=>" ", "STR_NBR"=>"", "STR_NBR2"=>"", "STR_DIRECTION"=>"", "STR_NM"=>"", "ZIP"=>""})
@victusfate
victusfate / webapp.js
Created November 16, 2010 20:52 — forked from visnup/README.js
var connect = require('connect')
, sys = require('sys');
var webapp = function(req, res) {
var path = req.url.split('/');
this[path[1]].apply(this, path.slice(2));
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end(sys.inspect(this));
};