Send iMessages from the Command Line
Just run the following in your shell:
| # Add this to a buildr 'buildfile' to receive growl notifications when compilation | |
| # completes or fails (including cc compilations) | |
| require 'ruby_gntp' | |
| # Growl setup | |
| Buildr.application.on_completion do |title, message| | |
| GNTP.notify({ | |
| :app_name => "buildr", | |
| :title => title, |
| // Remove the dreadful question and answers from the dashboard. | |
| setInterval(function() { | |
| $('li > div.post_content > div.post_question').parent().parent().remove(); | |
| }, 5000); |
| grades_table = Table :grades | |
| students_table = Table :students | |
| students_table_grades_table_join = join(students_table, grades_table, :_id, :student_id) | |
| students_table_grades_table_join_select = select(students_table_grades_table_join, '*') | |
| students_table_grades_table_join_select_filter = where(students_table_grades_table_join_select, students_table[:matric].eq('0824586')) | |
| students_table_grades_table_join_select_filter_order = order(students_table_grades_table_join_select_filter, grades_table[:mark]) | |
| students_table_grades_table_join_select_filter_order_limit = limit(students_table_grades_table_join_select_filter_order, 1) | |
| Output students_table_grades_table_join_select_filter_order_limit |
| customers_table = Table :customers | |
| customers_table_select = select(customers_table, '*') | |
| customers_table_select_limit = order(customers_table_select, 2) | |
| Output customers_table_select_order |
| if [ -d ~/.at-tools ] | |
| then | |
| echo "You already have Appleton Tower Tools installed. You'll need to remove ~/.at-tools if you want to install" | |
| exit | |
| fi | |
| echo "Cloning Appleton Tower Tools..." | |
| /usr/bin/env git clone git://github.com/lolsoft/at-tools.git ~/.at-tools | |
| echo "Installing on your system..." |
| Buildfile: /Users/cb/Documents/UoE/ug4/adbs/ex1/build.xml | |
| init: | |
| build: | |
| [javac] /Users/cb/Documents/UoE/ug4/adbs/ex1/build.xml:24: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds | |
| jar: | |
| BUILD SUCCESSFUL |
| Filesystem.new "/mount/point" do | |
| directory "hello", :perms => [:r, :w] do | |
| file "hello.txt" do |path| | |
| path # File contains its own path. | |
| end | |
| directory "goodbye" do | |
| handler SSHHandler.new(:username, :password) | |
| end | |
| end |
| require "zlib" | |
| class BloomFilter | |
| def initialize(size=100, hash_count=3) | |
| raise(ArgumentError, "negative or zero buffer size") if size <= 0 | |
| raise(ArgumentError, "negative or zero hash count") if hash_count <= 0 | |
| @size = size | |
| @hash_count = hash_count | |
| @buffer = Array.new(size, false) |
| Name | Action | Laps |
|---|---|---|
| Laps | Shot | 3 |
| Alcopop/Mixer | 5 | |
| Pint | 8 | |
| Ale | 10 | |
| Overtake | Down a pint | 3 |
| Fastest Lap | Dirty Pint | 40 |
| KERS (Once per pub) | Strawpedo | 8 |
| Grid Drop | Late to pub | -10 (per pub) |