This is a demonstration of using Ruby and the WiringPi Gem to pulse an LED connected to a GPIO pin in a manner similar to the sleep indicator on a MacBook.
A video of the effect can be found here: http://www.youtube.com/watch?v=NCUMXK7qf-c
# unicorn_rails -c /data/github/current/config/unicorn.rb -E production -D | |
rails_env = ENV['RAILS_ENV'] || 'production' | |
# 16 workers and 1 master | |
worker_processes (rails_env == 'production' ? 16 : 4) | |
# Load rails+github.git into the master before forking workers | |
# for super-fast worker spawn times | |
preload_app true |
-module(test_helper). | |
-export([riak_test/1]). | |
riak_test(Fun) -> | |
start_riak(), | |
{ok, Riak} = riak:local_client(), | |
Ret = (catch Fun(Riak)), | |
stop_riak(), | |
case Ret of |
-module(bucket_reloader). | |
-export([reload/3]). | |
reload(FromServer, ToServer, Bucket) -> | |
{ok, CFrom} = riak:client_connect(FromServer), | |
{ok, CTo} = riak:client_connect(ToServer), | |
{ok, Keys} = CFrom:list_keys(Bucket), | |
io:format("Transferring ~p keys~n", [length(Keys)]), | |
transfer(CFrom, CTo, Bucket, Keys, 0). |
# useful nginx configuration for reverse proxy with Apache | |
# edit lines 8, 11, and 30 | |
# taken from: http://syslog.tv/2010/01/11/debian-apache-2-nginx-wordpress-mu/ | |
# edits by jakebellacera (http://github.com/jakebellacera && http://jakebellacera.com) | |
server { | |
listen 80; | |
server_name domain.com *.domain.com; # edit this to your domain |
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Object#tap in JavaScript</title> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> | |
<script type="text/javascript" src="http://sugarjs.com/javascripts/sugar-0.9.5.min.js"></script> | |
<script type="text/javascript"> | |
jQuery.noConflict(); | |
(function($) { |
def output name=((default=true); "caius") | |
puts "name: #{name.inspect}" | |
puts "default: #{default.inspect}" | |
end | |
output | |
# >> name: "caius" | |
# >> default: true | |
output "avdi" |
<!doctype html> | |
<title>Site Maintenance</title> | |
<style> | |
body { text-align: center; padding: 150px; } | |
h1 { font-size: 50px; } | |
body { font: 20px Helvetica, sans-serif; color: #333; } | |
article { display: block; text-align: left; width: 650px; margin: 0 auto; } | |
a { color: #dc8100; text-decoration: none; } | |
a:hover { color: #333; text-decoration: none; } | |
</style> |
This is a demonstration of using Ruby and the WiringPi Gem to pulse an LED connected to a GPIO pin in a manner similar to the sleep indicator on a MacBook.
A video of the effect can be found here: http://www.youtube.com/watch?v=NCUMXK7qf-c
// Make our app module, its easier to do this in raw javascript | |
// and then put the rest of our app content (controllers etc) | |
// in their own coffeescript files. | |
// | |
// Your ng-app should include this module name, eg: <html ng-app="TodoApp"> | |
angular.module('TodoApp', []); |
s=IO.read(ARGV[0]);File.write(ARGV[0], s.gsub(";","\u037E")) |