This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CSS-Sprites alternatives | |
https://github.com/flyerhzm/css_sprite | |
* minimagick! | |
* dirty code | |
* hard to customize until refactored | |
https://github.com/railsjedi/sprite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
medium = ARGV.shift || 'Spinn' | |
user = ENV['USER'] | |
hostname = `hostname`.chomp | |
path = "/media/#{user}/#{medium}" | |
rc = "#{ENV['HOME']}/.bashrc-backup" | |
unless File.directory?(path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[main] | |
logdir=/var/log/puppet | |
vardir=/var/lib/puppet | |
ssldir=/var/lib/puppet/ssl | |
rundir=/var/run/puppet | |
factpath=$vardir/lib/facter:/home/guy/puppet/modules/rvm/lib/facter | |
prerun_command=/etc/puppet/etckeeper-commit-pre | |
postrun_command=/etc/puppet/etckeeper-commit-post | |
pluginsync=true | |
server=hurlg.lanpartei.de |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
def dpi | |
147 | |
end | |
def desktop | |
system "xrandr --output VGA1 --auto --left-of LVDS1 --output LVDS1 --auto --primary --dpi #{dpi}" | |
system "xset dpms force on" # wake up monitor from power saving mode | |
system "marble-mouse left" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# works with textnodes, too | |
Nokogiri::XML::Node.class_eval do | |
def to_hash | |
unless children.empty? | |
h = children.to_hash | |
if h.length == 1 && h.has_key?(:onlytext) | |
{ name => h[:onlytext] } | |
else | |
{ name => children.to_hash } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CompleteCapture < ActiveRecord::Base | |
TablesName = /\Acomplete_capture(\d+)s\z/ | |
SubClassName = /\ACompleteCapture(\d+)\z/ | |
self.abstract_class = true | |
cattr_accessor :company | |
include CapturedAt | |
class << self |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
please do me a favour: do the following on a amd64 ubuntu | |
$ gcc -o sizeof64 sizeof64.c | |
$ ./sizeof64 | |
are they different? would this be OK? If not, what could cause this? | |
If it is OK, why is ruby 1.9 not able to implement syscall() | |
https://github.com/ruby/ruby/blob/ruby_1_9_2/io.c#L7529 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# How to run a system command from ruby within a clean bash that has never sourced rvm using a custom ruby version | |
# 1) install rvm as the correct user | |
# 2) do NOT follow the instructions about sourcing and adding this to your .bashrc | |
# 3) run the following (change the versions accordingly) | |
ruby_versions = %w(ruby-1.8.7-p330 rbx-head) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# now you can use | |
# form.button :submit | |
# to get a real button that is stylable | |
class SimpleForm::FormBuilder | |
def submit_button(title=nil, options={}, &block) | |
title, options = nil, title if title.is_a?(Hash) | |
title ||= submit_default_value | |
options[:type] = 'submit' | |
template.add_class_to_html_options(options, 'submit') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package 'debootstrap' | |
package 'apt-cacher-ng' | |
package 'inotify-tools' | |
include_recipe 'lxc::manage' | |
include_recipe 'lxc::network_bridge' | |
include_recipe 'lxc::dns' | |
host = node[:container] |
OlderNewer