Make me an offer!
- Sperho (ball, charger and lead- no box)
- Red Desk lamp Very similar to this one
- Ten Stories About Smoking
| # | |
| # Cookbook Name:: whenever | |
| # Recipe:: default | |
| # | |
| # for the until instance named 'util' | |
| if node[:name] == 'util' | |
| ey_cloud_report "whenever" do | |
| message "Starting whenever recipe" | |
| end |
| $('a').each(function(i, a){a=$(a);var t=a.text();a.text('here');a.before('click ');a.after(' to go to '+t);}) |
Make me an offer!
Only tested in chrome, shove this in a bookmarklet:
javascript:void(function(){var r=(function(){var i,a,s;a=document.getElementsByTagName('link');for(i=0;i=0&&s.href) {var h=s.href.replace(/(&|%5C?)forceReload=\d+/,'');s.href=h+(h.indexOf('?')>=0?'&':'?')+'forceReload='+(new Date().valueOf())}}}); window.addEventListener('focus',r,false)})();
A parsing bug in ruby 1.9.2 allowed you to pass blocks to methods preceded by a comma. The bug only affected blocks with do/end and was fixed in 1.9.3.
http://bugs.ruby-lang.org/issues/5540
$ rvm use ruby 1.8.7
[1].inject :+, do |x| 1 end
# => SyntaxError: compile errorThis is a deconstuction of matematikaadit's submission to therubygame challenge 5; 'Roman numerals. What are they good IV?'. The goal of the challenge is to take a string representing a roman numeral as input and return the integer that the numeral represents.
matematikaadit currently has the honour of the shortest (by character count) submission for this challenge. At first glance I didn't understand how it worked so I re-wrote and analyzed it until I did.
matematikaadit's original submission:
| jQuery.fn.preventDefaultClick = function(f) { | |
| this.click(function(e){ | |
| f.call(this, e); | |
| e.preventDefault(); | |
| }); | |
| return this; | |
| } |
| file='' | |
| slow = [] | |
| File.readlines(file).each do |line| | |
| if line =~ /Load\ \(([\d\.]*)ms\)/ | |
| time = $1.to_f | |
| if time >= 500.0 | |
| slow << [time, line] | |
| end | |
| end |
| # Hacked from http://github.com/dball/zoomifier/blob/master/lib/zoomifier.rb | |
| require 'fileutils' | |
| require 'open-uri' | |
| require 'rubygems' | |
| require 'rmagick' | |
| require 'rexml/document' | |
| class Zoomify | |
| TILESIZE = 256 |
| #! /usr/bin/ruby | |
| # Saves two random and contiguous cropped images from a larger image | |
| # Written so an image that is too big can be displayed on a dual screen desktop | |
| IMAGE_NAME = "file_small.png" | |
| IMAGE_WIDTH, IMAGE_HEIGHT = IO.read(IMAGE_NAME)[0x10..0x18].unpack('NN') | |
| # # For non-pngs: | |
| # IMAGE_WIDTH, IMAGE_HEIGHT = [12304, 8605] |