On Sep 22, 2008, at 1:01 AM, Ashkan Soltani wrote:
just saw this go by...
http://sfbay.craigslist.org/eby/bik/850231294.html
On Mon, Sep 22, 2008 at 5:11 PM, Ryan Greenberg wrote:
On Sep 22, 2008, at 1:01 AM, Ashkan Soltani wrote:
just saw this go by...
http://sfbay.craigslist.org/eby/bik/850231294.html
On Mon, Sep 22, 2008 at 5:11 PM, Ryan Greenberg wrote:
#!/usr/bin/env ruby -KU | |
space_shuttle = <<EOS | |
_ | |
,' '. | |
/ \\ | |
^ | _ | ^ | |
| || / \\ || | | |
| |||.-.||| | | |
| ||| ||| | |
alias branches='for k in `git branch|sed s/^..//`;do echo -e `git log -1 --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" "$k"`\\t"$k";done|sort' |
(function($){ | |
if (typeof $ === 'undefined') { | |
alert('jQuery is required'); | |
return; | |
} | |
var highlightClass = 'scraper-helper-highlight'; | |
$('#scraper-helper-rule').remove(); | |
var style = '<style id="scraper-helper-rule">.' + highlightClass + ' { background-color: #fcc; }</script>'; | |
$(style).appendTo('head'); |
If had a Ruby linter or Ruby checkstyle program, I would want to configure it to detect the following things:
.map{|ea| ea}
vs. .map {|ea| ea}
vs. .map { |ea| ea }
, etc.)private
, protected
are consistently indented (or outdented)do...end
blocks must be used beyond a certain line lengthclass Rut(id: String, checksumDigit: String) { | |
def checksum: String = { | |
val digits = id.map(_.toString.toInt) | |
val digitsWithMultipliers = digits.zip( | |
Rut.ChecksumMultipliers.drop(Rut.ChecksumMultipliers.size - digits.size) | |
) | |
val productSum = digitsWithMultipliers.foldLeft(0)( | |
(acc, multipliers) => acc + multipliers._1 * multipliers._2 | |
) |
#!/usr/bin/env ruby -KU -rubygems | |
require 'sinatra' | |
get '/:time' do | |
sleep params[:time].to_i | |
"Just slept for #{sleep_time} seconds" | |
end |
This is code used to control the playback speed of a video playing in Quicktime Player. Upload arduino_read_potentiometer.cpp on your Arduino and run processing_control_video.pde in Processing. See video demo at http://www.youtube.com/watch?v=UfDRINiV4Kg
#!/usr/bin/env ruby -wKU | |
require 'date' | |
# strptime %z parses all of the following in Ruby | |
iso_8601_timezones = %[ | |
Z | |
UTC | |
PST |
#!/bin/bash | |
INPUT_FILE=input | |
OUTPUT_FILE=output | |
LAST_RUN=$(date "+%s") | |
LAST_MODIFIED=$LAST_RUN | |
touch $INPUT_FILE | |
touch $OUTPUT_FILE |