This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # source 'http://rubygems.org' | |
| source :gemcutter | |
| gem 'rails', '3.1.0.beta1' | |
| # Asset template engines | |
| gem 'json' | |
| gem 'sass' | |
| gem 'coffee-script' | |
| gem 'uglifier' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var Y, factorial; | |
| Y = function(le) { | |
| return (function(f) { | |
| return f(f); | |
| })(function(f) { | |
| return le(function(x) { | |
| return f(f)(x); | |
| }); | |
| }); | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### | |
| 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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'json' | |
| require 'redis' | |
| class RedisComments | |
| def initialize(redis,namespace,sort_proc=nil) | |
| @r = redis | |
| @namespace = namespace | |
| @sort_proc = sort_proc | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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"=>""}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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)); | |
| }; |