a list of slides from nodeconf
you may want to take a look at the jsconf-gist too!
| <?php | |
| /* | |
| * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
| * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
| * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
| * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
| * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
| * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
| * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| module MultiParameterAttributes | |
| def filter_time(attributes, name) | |
| attrs = attributes.collect do |key, value| | |
| if key =~ /^#{Regexp.escape(name.to_s)}\((\d+)(\w)\)$/ | |
| [$1.to_i, value.send("to_#$2")] | |
| end | |
| end.compact.sort_by(&:first).map(&:last) | |
| Time.zone.local(*attrs) unless attrs.empty? | |
| end |
| check host mongodb with address localhost | |
| start program = "/usr/bin/sudo /opt/database/mongo/bin/mongod" | |
| stop program = "/usr/bin/sudo /usr/bin/pkill -f mongod" | |
| if failed port 28017 protocol HTTP | |
| request / | |
| with timeout 10 seconds | |
| then start |
| source :gemcutter | |
| gem 'pit' | |
| gem 'sauberia-aws-s3' |
| # My pimped out unicorn config, with incremental killof | |
| # and all the latest capistrano & bundler-proofing | |
| # @jamiew :: http://github.com/jamiew | |
| application = "000000book.com" | |
| environment = ENV['RACK_ENV'] || ENV['RAILS_ENV'] || 'production' | |
| app_path = "/srv/#{application}" | |
| bundle_path = "#{app_path}/shared/bundle" | |
| timeout 30 |
| #!/bin/sh | |
| # ------------------------------------------------------------------------------ | |
| # SOME INFOS : fairly standard (debian) init script. | |
| # Note that node doesn't create a PID file (hence --make-pidfile) | |
| # has to be run in the background (hence --background) | |
| # and NOT as root (hence --chuid) | |
| # | |
| # MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit | |
| # INIT-INFO RULES http://wiki.debian.org/LSBInitScripts | |
| # INSTALL/REMOVE http://www.debian-administration.org/articles/28 |
| class Array | |
| def self.toy(n=10, &block) | |
| block_given? ? Array.new(n,&block) : Array.new(n) {|i| i+1} | |
| end | |
| end | |
| class Hash | |
| def self.toy(n=10) | |
| Hash[Array.toy(n).zip(Array.toy(n){|c| (96+(c+1)).chr})] | |
| end |
| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" | |
| "http://www.w3.org/TR/html4/strict.dtd"> | |
| <html lang="en"> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
| <title>untitled</title> | |
| <meta name="generator" content="TextMate http://macromates.com/"> | |
| <meta name="author" content="Alexandre Testu"> | |
| <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js" type="text/javascript" charset="utf-8"></script> |
| # example location parts of nginx.conf | |
| # add your own AWS keys, server lines etc, and set your aws domains, paths | |
| http { | |
| # you will need the luacrypto in the cpath, download from http://luacrypto.luaforge.net/ | |
| lua_package_cpath "/home/justin/lua/luacrypto-0.2.0/src/l?.so.0.2.0;;"; | |
| server { | |
| listen 80; |
a list of slides from nodeconf
you may want to take a look at the jsconf-gist too!