Public Gists by henrik

gist: 240336 Start Plex if not running. ...
Gravatar
Sat Nov 21 15:28:04 -0800 2009
1
2
3
-- Start Plex if not running. Make fullscreen if running windowed. Quit if running fullscreen.
-- By Henrik Nyh <http://henrik.nyh.se> 2009-11-22 under the MIT License.
-- Some code from http://forums.plexapp.com/index.php?/topic/8325-applescript-focusfullscreen-plex/
gist: 226410 Plex advancedsettings.xml f...
Gravatar
Wed Nov 04 13:34:05 -0800 2009
1
2
3
<?xml version="1.0"?>
<!--
Edit ~/Library/Application Support/Plex/userdata/advancedsettings.xml
gist: 214959 TextMate command to deploy ...
Gravatar
Wed Oct 21 00:55:47 -0700 2009
1
2
3
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
Gravatar
Fri Oct 09 01:31:51 -0700 2009
1
2
3
# Workaround to get "Page 1 of 2". Based on
# http://groups.google.com/group/prawn-ruby/msg/f08f8b0da9db6eb6
class Prawn::Document
gist: 204854 Basic stroke_dashed_horizon...
Gravatar
Thu Oct 08 01:07:43 -0700 2009
1
2
3
module Prawn::Graphics
  # E.g. stroke_dashed_horizontal_line(0, 5.cm, :at => 10.cm, :line_length => 1.cm, :space_length => 1.mm)
  # Currently rounds up line/space periods: 1 cm line length + 1 mm space as a 3 cm line would be "- - -", 3.2 cm total.
gist: 187561 Fix issue where adding "nod...
Gravatar
Tue Sep 15 12:39:27 -0700 2009
1
2
3
diff --git a/public/javascripts/jquery.tablednd_0_5.js b/public/javascripts/jquery.tablednd_0_5.js
index d4c9fec..e391a62 100644
--- a/public/javascripts/jquery.tablednd_0_5.js
Gravatar
Thu Sep 10 11:25:07 -0700 2009
1
2
3
#!/usr/bin/env ruby
#
# Git commit-msg hook. If your branch name is in the form "t123", automatically
Gravatar
Thu Sep 10 07:59:04 -0700 2009
1
2
3
// Make jQuery UI tabs pick the selected tab from the URL hash,
// and set the selected tab id as the hash.
//
gist: 182555 Make Ruby's Builder default...
Gravatar
Mon Sep 07 13:41:00 -0700 2009
1
2
3
# Make Builder default to CDATA and not bork numbers.
# By Henrik Nyh <http://henrik.nyh.se> 2009-08-07 under the MIT license.
 
gist: 179953 Simple MySQL "LIKE"-based i...
Gravatar
Wed Sep 02 13:58:10 -0700 2009
1
2
3
class Foo < ActiveRecord::Base
 
  named_scope :infix_search, lambda { |string|
Gravatar
Fri Aug 28 23:56:58 -0700 2009
1
2
3
      === Epic Snow Leopard Upgrayyyyd Guide ===
 
Son, you’re now living in the land of 64-bit systems.
gist: 175523 Simple breadcrumb trail for...
Gravatar
Wed Aug 26 07:14:18 -0700 2009
1
2
You are here:
<%= trail.to_html(response) %>
gist: 146844 Recursively diff two Ruby h...
Gravatar
Tue Jul 14 01:38:16 -0700 2009
1
2
3
# Recursively diff two hashes, showing only the differing values.
# By Henrik Nyh <http://henrik.nyh.se> 2009-07-14 under the MIT license.
#
gist: 146080 Simple per-branch databases...
Gravatar
Mon Jul 13 05:21:07 -0700 2009
1
2
3
shared: &shared
  # Use different adapters with JRuby vs. MRI
  adapter: <%= defined?(JRuby) ? "jdbcmysql" : "mysql" %>
gist: 144570 Spotify version of http://h...
Gravatar
Fri Jul 10 07:47:27 -0700 2009
1
2
#!/bin/bash
ssh mini "osascript -e 'tell app \"Spotify\" to activate' -e 'tell app \"System Events\" to keystroke (ASCII character 29) using {command down}'"
gist: 129167 TextMate "Open Finder" comm...
Gravatar
Sat Jun 13 02:42:03 -0700 2009
1
2
3
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
gist: 100135 Standard Jekyll WordPress i...
Gravatar
Wed Apr 22 15:33:04 -0700 2009
1
2
3
require 'rubygems'
require 'sequel'
require 'fileutils'
gist: 97822 Insane mod_rewrite gymnasti...
Gravatar
Sat Apr 18 16:15:24 -0700 2009
1
2
3
RewriteEngine On
 
# Map http://henrik.nyh.se to /jekyll.
Gravatar
Sat Apr 18 09:36:02 -0700 2009
1
2
3
# Illustrates an RDiscount issue.
#
# Seen in the wild in Jekyll (http://github.com/mojombo/jekyll) blog posts
gist: 96749 GitHub Flavored Markdown
Gravatar
Thu Apr 16 16:23:18 -0700 2009
1
2
3
  # GitHub Flavored Markdown Layer
  def fix_markdown_quirks(text)
    # prevent foo_bar_baz from ending up with an italic word in the middle