Skip to content

Instantly share code, notes, and snippets.

# Converts URIs that go beyond the set of ASCII Charset ("Umlautdomains")
# into usable ones for ruby
#
# EXPERIMENTAL - but seems to work pretty good so far
#
module UTF8URI
# needs punycode4r gem !
require 'punycode'
def self.encode(url)
@maxigs
maxigs / plistmerge.rb
Created February 14, 2012 12:22
Script to merge values from a plist into another file
#!/usr/bin/env ruby
if ARGV.size != 2
puts "Merges Fields from Plist-Files together into a new file"
puts "USAGE: ./plistmerge.rb source-file input-file"
exit
end
# The values for those fields will be migrated from the source to the target file
FieldsToMigrate = %w(latitude longitude)
@maxigs
maxigs / licenses.rb
Created October 1, 2012 09:42
Script to copy the gem licenses into doc folder
#!/usr/bin/env ruby
#
# Put this file in script/licenses.rb
# and make executeable
# $ chmod +x script/licenses.rb
#
# Call with
# $ script/licenses.rb
ROOT_PATH = File.expand_path('../../', __FILE__)
Jun 17 21:54:30 dexter kernel: [ 6907.974616] Large kmem_alloc(1907720, 0x1000), please file an issue at:
Jun 17 21:54:30 dexter kernel: [ 6907.974616] https://github.com/zfsonlinux/zfs/issues/new
Jun 17 21:54:30 dexter kernel: [ 6907.974631] CPU: 0 PID: 7767 Comm: spa_async Tainted: P OX 3.13.0-44-generic #73-Ubuntu
Jun 17 21:54:30 dexter kernel: [ 6907.974635] Hardware name: Acer Aspire easyStore H341/Aspire easyStore H341, BIOS P04 04/22/2010
Jun 17 21:54:30 dexter kernel: [ 6907.974640] 000000000000c2d0 ffff880007643d00 ffffffff81720d86 0000000000000000
Jun 17 21:54:30 dexter kernel: [ 6907.974650] ffff880007643d38 ffffffffa0088b4f ffff880020192000 ffff880020195000
Jun 17 21:54:30 dexter kernel: [ 6907.974658] 0000000000e3130e 000000000003a381 ffff880020192000 ffff880007643d90
Jun 17 21:54:30 dexter kernel: [ 6907.974665] Call Trace:
Jun 17 21:54:30 dexter kernel: [ 6907.974680] [<ffffffff81720d86>] dump_stack+0x45/0x56
Jun 17 21:54:30 dexter kernel: [ 6907.974706] [<ffffffffa0088b4f>]
# Parses a URL containing the SMTP Config (Credentials and other options supported)
# Use from application.rb or in environments.
#
# Example:
#
# if ENV["SMTP_URL"]
# config.action_mailer.delivery_method = :smtp
# config.action_mailer.smtp_settings = SmtpConfig.from_url(ENV["SMTP_URL"])
# end
#