Skip to content

Instantly share code, notes, and snippets.

View flexd's full-sized avatar

Kristoffer Berdal flexd

  • Oslo, Norway
  • 17:27 (UTC +02:00)
View GitHub Profile
# encoding: utf-8
require 'redis'
require 'redis/hash_key'
$redis = Redis.new
@hash = Redis::HashKey.new('Memo')
@hash[:memos]['dominikh'] = "Some text"
@hash['b'] = 2
@hash.each do |k,v|
puts "#{k} = #{v}"
end
[17868] 13 Dec 20:18:19 - Accepted 127.0.0.1:59466
[17868] 13 Dec 20:18:22 - DB 0: 1 keys (0 volatile) in 4 slots HT.
[17868] 13 Dec 20:18:22 - 1 clients connected (0 slaves), 726264 bytes in use
kristoffer@dev:~/code/cinch$ ruby -I ./lib/ examples/plugins/memo.rb
/home/kristoffer/code/cinch/lib/cinch/storage/redis.rb:9:in `initialize': wrong number of arguments (1 for 2) (ArgumentError)
from /home/kristoffer/code/cinch/lib/cinch/storage/redis.rb:11:in `new'
from /home/kristoffer/code/cinch/lib/cinch/storage/redis.rb:11:in `initialize'
from /home/kristoffer/code/cinch/lib/cinch/plugin.rb:378:in `new'
from /home/kristoffer/code/cinch/lib/cinch/plugin.rb:378:in `initialize'
from examples/plugins/memo.rb:16:in `initialize'
from /home/kristoffer/code/cinch/lib/cinch/plugin_list.rb:11:in `new'
from /home/kristoffer/code/cinch/lib/cinch/plugin_list.rb:11:in `register_plugin'
from /home/kristoffer/code/cinch/lib/cinch/plugin_list.rb:16:in `block in register_plugins'
require "cinch/storage"
require "redis"
require "redis/objects"
require "redis/hash_key"
module Cinch
class Storage
class Redis < Storage
def initialize(options, plugin)
# New Redis object, thread safe by default since 2.2.0
"Gitt ; Under hensyntagen til ; I lys av ; Vedrørende ; Grunnet ; I betraktning av ; Forutsatt ; Med utgangspunkt i ; I forhold til ; Sett hen til ; I henhold til ; Med tanke på ; Uavhengig av ; Sett på bakgrunn av ; Sammenholdt med ; På grunn av ; Med hensyn til ; Under forutsetning av ; Etter en totalvurdering av ; Uten hensyn til ; Avhengig av ; På grunnlag av ; I og med ; Under henvisning til::en integrert ; en optimal ; en sømløs ; en implisitt ; en proaktiv ; en betydelig ; en økt ; en vesentlig ; en ikke ubetydelig ; en kostnadseffektiv ; en avtagende ; en vedvarende ; en tiltagende ; en gjeldende ; en helhetlig ; en manglende ; en særlig ; en løpende ; en langsiktig ; en bærekraftig ; en resultatorientert ; en tverrfaglig ; en kommunikativ ; en inkluderende::målsetting ; effekt ; struktur ; agenda ; tidshorisont ; overveielse ; mobilitet ; treffsikkerhet ; innsats ; kvalitetssikring ; problematikk ; ressursbruk ; avveining ; avklaring ; implementering ; styringsinnsats ; innovasjon ; effektivisering ;
@flexd
flexd / antialias.js
Created September 16, 2011 15:54
Quick jQuery hack to enable CSS anti-aliasing while keeping the CSS validating.
$("body").css("-webkit-font-smoothing", "antialiased");
@flexd
flexd / style.css
Created September 16, 2011 15:47
CSS anti-aliasing in different browsers
# WebKit browsers
body {
-webkit-font-smoothing: antialiased;
}
# Gecko (Firefox) browsers
body {
-moz-font-smoothing: antialiased;
}
@flexd
flexd / main.css
Created September 12, 2011 15:05
CSS for anti-aliasing
body {
background-color: #F9F7ED;
font-family: Georgia, Ubuntu, serif;
-webkit-font-smoothing: antialiased;
}
playworkschool:myapp2 Kristoffer$ rake
(in /Users/Kristoffer/myapp2)
missing config/settings.yml
create config/settings.yml
missing config/redis/test.conf
create config/redis/test.conf
/Users/Kristoffer/myapp2/vendor/quietbacktrace-0.1.1/lib/quietbacktrace.rb:153:in `<top (required)>': uninitialized constant Test::Unit::Util (NameError)
from /Users/Kristoffer/myapp2/test/test_helper.rb:8:in `require'
from /Users/Kristoffer/myapp2/test/test_helper.rb:8:in `<top (required)>'
from /Users/Kristoffer/myapp2/test/routes/css_test.rb:1:in `require'
def self.find_or_load_by_name(name)
if name.downcase == "none" then return nil end
alliance = self.find_by_name(name)
if !alliance
self.do_update
alliance = self.find_by_name(name)
end
return alliance
end