This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'nokogiri' | |
require 'fileutils' | |
require 'date' | |
# usage: ruby import.rb my-blog.xml | |
# my-blog.xml is a file from Settings -> Basic -> Export in blogger. | |
data = File.read ARGV[0] | |
doc = Nokogiri::XML(data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> test:test | |
unit: should include file:/Users/patric/Dropbox/tmp/sbt/src/test/scala/com/springer/core/functional/foo/FunctionalTest.scala => false | |
unit: should include file:/Users/patric/Dropbox/tmp/sbt/src/test/scala/com/springer/core/integration/foo/IntegrationTest.scala => false | |
unit: should include file:/Users/patric/Dropbox/tmp/sbt/src/test/scala/com/springer/core/shared/utils/Clock.scala => true | |
unit: should include file:/Users/patric/Dropbox/tmp/sbt/src/test/scala/com/springer/core/system/foo/SystemTest.scala => false | |
unit: should include file:/Users/patric/Dropbox/tmp/sbt/src/test/scala/com/springer/core/unit/foo/UnitTest.scala => true | |
[info] Compiling 2 Scala sources to /Users/patric/Dropbox/tmp/sbt/target/scala-2.10/test-classes... | |
[info] UnitTest: | |
[info] - should run a unit test | |
[info] Passed: : Total 1, Failed 0, Errors 0, Passed 1, Skipped 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# switch between different jdk versions. usage: jdk 1.7 | |
function jdk() { | |
if [ $# -ne 0 ]; then | |
if [ -n "${JAVA_HOME+x}" ]; then | |
removeFromPath $JAVA_HOME | |
fi | |
export JAVA_HOME="/opt/java/jdk-$@" | |
export PATH=$JAVA_HOME/bin:$PATH | |
fi | |
echo JAVA_HOME set to $JAVA_HOME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"spanDepths": { | |
"-3545230476842099781": 1, | |
"4547029349960013747": 2 | |
}, | |
"trace": { | |
"duration": 43000, | |
"endTimestamp": 1401378812420000, | |
"serviceCounts": { | |
"service-a": 1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// service A | |
val tracer = ZipkinTracer.mk(host = "localhost", port = 9410, sampleRate = 1) | |
Trace.unwind { | |
Trace.pushTracerAndSetNextId(tracer) | |
Trace.recordRpcname("service-A", "GET") | |
Trace.record(Annotation.ServerRecv()) | |
// client call to service B (see below) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function addToPath() { | |
export PATH=$1:$PATH | |
} | |
function removeFromPath() { | |
export PATH=$(echo $PATH | sed -E -e "s;:$1;;" -e "s;$1:?;;") | |
} | |
# switch between different jdk versions. usage: jdk 1.7 | |
function jdk() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
E, [2014-08-14T17:34:04.328831 #87010] ERROR -- : Ridley::Errors::ClientError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed | |
E, [2014-08-14T17:34:04.328945 #87010] ERROR -- : /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0.pre2/lib/celluloid/responses.rb:29:in `value' | |
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0.pre2/lib/celluloid/calls.rb:92:in `value' | |
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0.pre2/lib/celluloid/proxies/sync_proxy.rb:33:in `method_missing' | |
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0.pre2/lib/celluloid/proxies/cell_proxy.rb:17:in `_send_' | |
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0.pre2/lib/celluloid/pool_manager.rb:41:in `_send_' | |
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0.pre2/lib/celluloid/pool_manager.rb:140:in `method_missing' | |
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0.pre2/lib/celluloid/calls.rb:26:in `public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns cracking.p_02_05 | |
(:require [clojure.test :refer :all])) | |
(defn different? [[a b]] (not (= a b))) | |
(defn first-elem [[a b]] a) | |
; This is a solution using "Floyd's cycle-finding algorithm" | |
(defn detect-loop [coll] | |
(let [tortoise (drop 1 coll) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
grep -rh '@mixin' web/public/css | cut -d' ' -f2 | egrep -o '^[a-z\-]+' > /tmp/mixins | |
for mixin in `cat /tmp/mixins`; do | |
echo --- $mixin | |
grep --exclude mixin.names -ri "@include $mixin" web/public/css | grep -v '//' | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# starting point | |
# | |
class DeployCLI | |
def run | |
template, args = ... | |
TemplateRenderer.new.render(template, args) | |
end | |
end |
OlderNewer