a list of slides from nodeconf
you may want to take a look at the jsconf-gist too!
| [submodule "amqp"] | |
| path = amqp | |
| url = http://github.com/ry/node-amqp.git |
| Suggestions from the 11 hackers at the table: | |
| * Use connection pooling (pgpool). | |
| * Don't expect reporters to get excited until you can show them something. (Find a way to appeal to reporters interests.) | |
| * Only update what's changed. (e.g. on election results: show changes, not raw numbers) | |
| * Use the AP's "dbready" format for election results. | |
| * Use CSV for everything. | |
| * Use pdb with runserver for debugging. | |
| * Beware circular imports when using Haystack. | |
| * Make the case for building news apps with government data. (Niran will provide numbers showing that people look at it.) |
| #!/bin/bash | |
| # | |
| # A better PS1 for Git | |
| # | |
| # Author: Justin Hileman (http://justinhileman.com) | |
| # | |
| # Installation: | |
| # Add the following function to your `.bashrc` or `.bash_profile`, | |
| # or save it somewhere (e.g. `~/.gps1.bash`) and source it in `.bashrc` |
| define("can", ["has"], function(has){ | |
| return { | |
| has: function(test, callback){ | |
| // summary: doublepluscool has.js intergration | |
| // example: | |
| // can.has("array-forEach", function(ihas){ | |
| // if(ihas){ | |
| // // There is a native Array.prototype.forEach | |
| // } |
| /* | |
| As of version 1.1.2, Propane will load and execute the contents of | |
| ~Library/Application Support/Propane/unsupported/caveatPatchor.js | |
| immediately following the execution of its own enhancer.js file. | |
| You can use this mechanism to add your own customizations to Campfire | |
| in Propane. | |
| Below you'll find two customization examples. |
| # Example how to add rich editor capabilities to your models in admin. | |
| from django.contrib.admin import site, ModelAdmin | |
| import models | |
| # we define our resources to add to admin pages | |
| class CommonMedia: | |
| js = ( | |
| 'https://ajax.googleapis.com/ajax/libs/dojo/1.6.0/dojo/dojo.xd.js', |
| if RUBY_ENGINE == 'macruby' | |
| framework 'CoreServices' | |
| WATCHED_EXTS = "rb,builder,erb,nokogiri" | |
| PASSENGER_RESTART_FILE = File.expand_path(File.join(File.dirname(__FILE__), "..", "tmp", "restart.txt")) | |
| DELAY = 3 | |
| def modified_files(path) | |
| Dir.glob("#{File.expand_path(path)}/*.{#{WATCHED_EXTS}}").map do |filename| | |
| begin |
a list of slides from nodeconf
you may want to take a look at the jsconf-gist too!
| require "ffi" | |
| class ULLEnum < FFI::Enum | |
| def native_type | |
| FFI::Type::ULONG_LONG | |
| end | |
| end | |
| class MachMsgHeader < FFI::Struct | |
| layout :bits, :uint, :size, :uint, :remote_port, :uint, :local_port, :uint, :reserved, :uint, :id, :int |
| #!/usr/bin/env ruby | |
| FSCRIPT_PATH = "/Library/Frameworks/FScript.framework" | |
| if ARGV.empty? | |
| puts "Usage: #{$0} process_name" | |
| exit | |
| end | |
| GDB = IO.popen("gdb", 'w') |