I hereby claim:
- I am marcel on github.
- I am marcelmolina (https://keybase.io/marcelmolina) on keybase.
- I have a public key ASAuJPmRumV3sIFsF6idkKy9B6sUI34TkSaG3HIpdB3tzwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
# v1beta1.Deployment: Deployment enables declarative updates for Pods and ReplicaSets. | |
# (apiVersion <string>): APIVersion defines the versioned schema of this | |
# representation of an object. Servers should convert recognized schemas to the | |
# latest internal value, and may reject unrecognized values. More info: | |
# http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources | |
apiVersion: | |
# (kind <string>): Kind is a string value representing the REST resource this | |
# object represents. Servers may infer this from the endpoint the client submits | |
# requests to. Cannot be updated. In CamelCase. More info: |
Puun alla katselen, (under the tree I watch) | |
lentäviä tähtiä (the flying stars [shooting stars]) | |
Puun alla uneksin (under the tree i dream of) | |
Rakkaudesta ikuisesta (love everlasting) | |
[chorus] | |
jos voisin kiivetä (if I could climb) | |
korkealle (way up high) | |
voisin nähdä kaiken (I could see it all) |
import scala.util.matching.Regex | |
import scala.util.matching.Regex.Match | |
trait RegexExtractor[M] { | |
def pattner: Regex | |
def unapply(line: String): Option[M] = { | |
pattern.findFirstMatchIn(line) map { matches => | |
extractMatches(matches) | |
} |
require "rubygems" | |
require "rbench" | |
require "set" | |
RANGE = (1..1000) | |
ARRAY = RANGE.to_a | |
SET = Set.new(ARRAY) | |
WORST_CASE_COMPLEXITY = ARRAY.size + 1 |
#!/usr/bin/env ruby | |
# giftube – Generates an animated gif from a YouTube url. | |
# | |
# Usage: | |
# | |
# giftube [youtube url] [minute:second] [duration] | |
# | |
# ex. | |
# |
import java.util.concurrent.{BlockingQueue, ArrayBlockingQueue, CountDownLatch, Executors, TimeUnit} | |
/* | |
Abstracts away the common pattern of producing items into a queue that are | |
consumed concurrently by a pool of workers. | |
*/ | |
class ConcurrentBlockingQueueConsumer[T](queue: BlockingQueue[T], producer: Iterator[T], concurrencyLevel: Int) { | |
lazy val stopLatch = new CountDownLatch(1) | |
lazy val pool = Executors.newFixedThreadPool(concurrencyLevel) |
intersections = Hash.new do |h, k| | |
# k = segment type 1 | |
h[k] = Hash.new do |h, k| | |
# k = segment value 1 | |
h[k] = Hash.new do |h, k| | |
# k = segment type 2 | |
h[k] = {} | |
end | |
end | |
end |
module Kernel | |
def m(object=Object.new, pattern=nil) | |
methods = object.public_methods(false).sort | |
methods = methods.grep pattern unless pattern.nil? | |
ObjectMethods.new(methods) | |
end | |
class ObjectMethods < Array | |
def inspect | |
puts sort |
module Twurl | |
class OAuthClient | |
class << self | |
def rcfile(reload = false) | |
if reload || @rcfile.nil? | |
@rcfile = RCFile.new | |
end | |
@rcfile | |
end |