I hereby claim:
- I am lwe on github.
- I am lwe (https://keybase.io/lwe) on keybase.
- I have a public key ASBR3o4RHUCJWVKn-5UvI43Qry8SjTb6YzhWGhdK__YOYwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
var Hapi = require('hapi'); | |
var stream = require('stream'); | |
// Create a server | |
var server = Hapi.createServer('localhost', 8000); | |
// Add a route | |
server.route({ | |
method: 'GET', | |
path: '/hello', |
source 'https://rubygems.org' | |
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | |
gem 'rails', '4.0.0.beta1' | |
gem 'sqlite3' | |
# THIS BREAKS IT, though when it's at the end of the file it works... | |
gem 'haml', '~> 3.1' |
require 'sidekiq' | |
require 'sidekiq/manager' | |
require 'sidekiq/scheduled' | |
class SidekiqService | |
attr_reader :options, :manager | |
def initialize(options = {}) | |
@options = options |
#compdef rbfu | |
local curcontext="$curcontext" state line _rubies _rubies_dir ret=1 | |
_arguments -w -S \ | |
'(-)--help[show usage and exit]: :->noargs' \ | |
'1: :->versions' \ | |
'*::: :->args' && ret=0 | |
case $state in |
# Provides the ability to unscope associations, this solves problems described in | |
# http://stackoverflow.com/questions/1540645/how-to-disable-default-scope-for-a-belongs-to/11012633#11012633 | |
# | |
# Examples | |
# | |
# class Document < ActiveRecord::Base | |
# default_scope where(deleted: false) | |
# end | |
# | |
# class Comment < ActiveRecord::Base |
{ | |
"took" : 45, | |
"timed_out" : false, | |
"_shards" : { | |
"total" : 5, | |
"successful" : 5, | |
"failed" : 0 | |
}, | |
"hits" : { | |
"total" : 4, |
require 'rubygems' | |
require 'nokogiri' | |
puts "Platform: #{RUBY_PLATFORM}" | |
puts "Nokogiri: #{Nokogiri::VERSION}" | |
xml = <<XML | |
<foo:bar> | |
<some>value</some> | |
<other>1234</other> |
#!/usr/bin/ruby -w | |
require 'rubygems' | |
require 'optparse' | |
require 'rack' | |
# setup options | |
options = { :Port => 4000, :Host => "0.0.0.0" } | |
opt_parser = OptionParser.new do |opts| | |
opts.banner = "Usage: serveme [-p PORT] [-h HOST] [-s thin|webrick|...]" |
module TelHelper | |
# Erstellt einen <a href="tel:..."> link. | |
def tel_to(telephone_number, name = nil, html_options = {}) | |
href = html_escape telephone_number.to_s.strip.sub(/\A\+/, '00').gsub(/(\(.+\))/, '').gsub(/[^\d]/, '') | |
content_tag "a", name || telephone_number, html_options.stringify_keys.merge("href" => "tel:#{href}".html_safe) | |
end | |
end |