Skip to content

Instantly share code, notes, and snippets.

View arvida's full-sized avatar

Arvid Andersson arvida

View GitHub Profile
sudo '/Applications/Install OS X Yosemite.app/Contents/Resources/createinstallmedia' --volume '/Volumes/Yosemite' --applicationpath '/Applications/Install OS X Yosemite.app' --nointeraction
@arvida
arvida / ree-1.8.7-2012.02-fix-CVE-2013-4164.patch
Created November 22, 2013 17:09
Possible fix for Ruby Enterprise Edition to patch ”Heap Overflow in Floating Point Parsing (CVE-2013-4164)” (https://www.ruby-lang.org/en/news/2013/11/22/heap-overflow-in-floating-point-parsing-cve-2013-4164/). Apply with: wget http://rubyenterpriseedition.googlecode.com/files/ruby-enterprise-1.8.7-2012.02.tar.gz tar -zxf ruby-enterprise-1.8.7-2…
--- /Users/arvid/Desktop/ruby-enterprise-1.8.7-2012.02 2/source/util.c 2012-02-19 15:09:11.000000000 +0100
+++ /Users/arvid/Desktop/ruby-enterprise-1.8.7-2012.02/source/util.c 2013-11-22 16:25:02.000000000 +0100
@@ -106,11 +106,11 @@
* Style 1: The suffix begins with a '.'. The extension is replaced.
* If the name matches the original name, use the fallback method.
*
- * Style 2: The suffix is a single character, not a '.'. Try to add the
+ * Style 2: The suffix is a single character, not a '.'. Try to add the
* suffix to the following places, using the first one that works.
- * [1] Append to extension.
@arvida
arvida / heroku_utf8_hack.rb
Created September 11, 2011 10:44
Force Rails 3.1 ActiveRecord connection to be UTF8 on Heroku
class Rails::Application::Configuration
def database_configuration
require 'erb'
YAML::load(ERB.new(IO.read(paths["config/database"].first)).result).each_value do |env|
env.merge!({
'encoding' => 'utf8',
'collation' => 'utf8_general_ci'
})
end
end
@arvida
arvida / morsan-lunch.rb
Created December 10, 2010 14:33
Post the lunch menu from Morsan (Awesome cafe in Hornstull Stockholm, http://www.hosmorsan.se) to a Campfire chat room. THANKS to @mattiasottosson for making the menu available as json
require 'rubygems'
require 'uri'
require 'yajl/http_stream'
require 'tinder'
CAMPFIRE_SUBDOMAIN = ''
CAMPFIRE_TOKEN = ''
CAMPFIRE_ROOM = ''
results = Yajl::HttpStream.get(URI.parse('http://morsan.wanda.st/current_menu.json'))
@arvida
arvida / gist:727125
Created December 3, 2010 15:56
Double Accounting
* http://homepages.tcp.co.uk/~m-wigley/gc_wp_ded.html
* http://www.cuppadev.co.uk/dev/double-entry-accounting-in-rails/
* https://github.com/niklas/bookkeeper/commit/80163def82f68f9b001fa7dd1a3ef3d4c76e82a9
* https://github.com/mbulat/plutus