My Recent Pastes (71 and counting)
All Pasties (over 71 and counting)
Below are summaries of the 15 most recent pasties by Henrik N.
November 16, 2008
5:47AM EDT
by Henrik N
View more (19 lines)
1 2 3 4 5 |
// By Barney Boisvert: http://www.barneyb.com/barneyblog/2008/01/08/checkbox-range-selection-a-la-gmail/ // Modified by Henrik Nyh <http://henrik.nyh.se> 2008-11-16 to support rebinding (e.g. after sorting). (function($) { $.fn.enableCheckboxRangeSelection = function() { |
November 10, 2008
3:24AM EDT
by Henrik N
View more (18 lines)
1 2 3 4 5 |
Paperclip.options[:image_magick_path] = '/opt/local/bin' class Paperclip::Attachment def assign_with_mimetype_fu(uploaded_file) |
October 08, 2008
2:15PM EDT
by Henrik N
View more (122 lines)
1 2 3 4 5 |
#!/usr/bin/env ruby # SweDB XMLTV Grabber for EyeTV # by Henrik Nyh <http://henrik.nyh.se> 2008-03-09. # Free to modify and redistribute with credit. |
September 16, 2008
3:55AM EDT
by Henrik N
View more (12 lines)
1 2 3 4 5 |
module Mod def self.proc Proc.new {|x,y| puts "self = #{self}; [x,y] = #{[x,y].inspect}" } end end |
September 14, 2008
7:31PM EDT
by Henrik N
View more (126 lines)
1 2 3 4 5 |
#!/usr/bin/env ruby # SweDB XMLTV Grabber for EyeTV # by Henrik Nyh <http://henrik.nyh.se>. # Free to modify and redistribute with credit. |
September 03, 2008
6:47AM EDT
by Henrik N
View more (9 lines)
1 2 3 4 5 |
if [[ -d $TM_SELECTED_FILE ]]; then TM_PATH="$TM_SELECTED_FILE" elif [[ -f $TM_SELECTED_FILE ]]; then TM_PATH="`dirname "$TM_SELECTED_FILE"`" else |
August 18, 2008
7:32AM EDT
by Henrik N
View more (19 lines)
1 2 3 4 5 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html lang="en"> <head> |
August 03, 2008
1:53PM EDT
by Henrik N
View more (51 lines)
1 2 3 4 5 |
# Parses config/site.yml and creates an OpenStruct-like Site configuration object. # The site.yml file can use ERB, just like fixture yml files. # The file is expected to have a top-level key for the current Rails environment. # Its values become attribute on the Site object. # Values that have sub-keys become nested objects. |
June 22, 2008
5:51AM EDT
by Henrik N
View more (8 lines)
1 2 3 4 5 |
module OSA class << self; alias_method :broken_sym_to_code, :sym_to_code; end def self.sym_to_code(sym) sym = sym.to_s.gsub("_", " ").to_sym |
June 22, 2008
5:29AM EDT
by Henrik N
View more (13 lines)
1 2 3 4 5 |
--- rbosa.rb (saved version) +++ (current document) @@ -220,7 +220,9 @@ end |
June 07, 2008
4:18PM EDT
by Henrik N
View more (29 lines)
1 2 3 4 5 |
class ActiveRecord::Base def self.unprotected_create!(*args) with_unprotected_attributes { create!(*args) } end |
May 24, 2008
7:03PM EDT
by Henrik N
View more (14 lines)
1 2 3 4 5 |
set front_app to (path to frontmost application as Unicode text) tell app "Finder" reveal (POSIX file "/tmp/share.png" as alias) activate |
May 24, 2008
6:52PM EDT
by Henrik N
1 2 3 |
#!/bin/bash screencapture -i /tmp/share.png && scp /tmp/share.png hyper:/tmp && ssh hyper "osascript -e 'set front_app to (path to frontmost application as Unicode text)' -e 'tell app \"Finder\"' -e 'reveal (POSIX file \"/tmp/share.png\" as alias)' -e 'activate' -e 'tell app \"System Events\" to keystroke \"y\" using {command down, option down}' -e 'delay 8' -e 'tell app \"System Events\" to key code 53 --esc' -e 'close window 1' -e 'end tell' -e 'tell app front_app to activate --return focus' " |
May 24, 2008
8:08AM EDT
by Henrik N
View more (21 lines)
1 2 3 4 5 |
-- By Henrik Nyh, 2008-05-24. -- http://henrik.nyh.se/2008/05/iphoto-library-manager-shortcuts-with-drag-and-drop-importing -- Free to modify and redistribute with due credit. on run |
Pastie