This file contains hidden or 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 follow_json_log { | |
| if [ -n "$1" ] | |
| then | |
| jq -R "fromjson? | select (type == \"object\") | $1" | |
| else | |
| jq -R 'fromjson? | select (type == "object")' | |
| fi | |
| } |
This file contains hidden or 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 follow_json_log { | |
| jq -R 'fromjson? | select (type == "object") | .message' | |
| } |
This file contains hidden or 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
| (def jetty-req-q (java.util.concurrent.ArrayBlockingQueue. configuration/http-queue-length)) | |
| (defn create-threadpool [options] | |
| (let [pool (org.eclipse.jetty.util.thread.QueuedThreadPool. (options :max-threads configuration/http-max-threads) | |
| (options :min-threads configuration/http-min-threads) | |
| 0 | |
| jetty-req-q)] | |
| (.setMinThreads pool (options :min-threads configuration/http-min-threads)) | |
| (when (:daemon? options false) | |
| (.setDaemon pool true)) |
This file contains hidden or 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 user) | |
| ;@here if anyone wants a small friday challenge. Create an algorithm that | |
| ;ensures that for any given sequence there is no more than a run of 2 of the | |
| ;same type. Try to preserve the order as much as possible. | |
| ;ie: not a random shuffle. There can be a continuous run of more than 2 | |
| ;at the end of the sequence | |
| (def problem [:a :a :a :a :a :a :b :b :c :a :b :b :b]) | |
| (def large-problem (doall (map (fn [_] | |
| (->> #{:a :b :c} |
This file contains hidden or 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
| -module(afile_client). | |
| -export([ls/1, get_file/2, put_file/3]). | |
| ls(Server) -> | |
| Server ! {self(), list_dir}, | |
| receive | |
| {Server, FileList} -> | |
| FileList | |
| end. |
This file contains hidden or 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
| #!/bin/bash | |
| set -e | |
| # yo need to set | |
| # all values must be url encoded! | |
| # export MONDO_EMAIL | |
| # export MONDO_PASSWORD | |
| # export MONDO_CLIENT_ID | |
| # export MONDO_CLIENT_SECRET |
This file contains hidden or 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>Label</key> | |
| <string>velrok.gittify-uswitch-notes.plist</string> | |
| <key>WorkingDirectory</key> | |
| <string>/Users/waldemarschwan/Google Drive/notes</string> |
This file contains hidden or 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
| FROM java:7 | |
| MAINTAINER Velrok | |
| RUN mkdir -p /opt/mb | |
| ADD ./target/mb.jar /opt/mb/mb.jar | |
| ADD ./VERSION /opt/mb/VERSION | |
| ADD ./public /opt/mb/public | |
| WORKDIR /opt/mb |
This file contains hidden or 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
| #!/bin/bash | |
| set -e | |
| lein ring uberjar | |
| ./increment_version.rb $@ | |
| docker build --rm=true -t registry.giantswarm.io/velrok/mb:$(cat ./VERSION) . | |
| docker push registry.giantswarm.io/velrok/mb:$(cat ./VERSION) |
This file contains hidden or 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
| swarm delete -y mb | |
| swarm create --var=version=$(cat ./VERSION) swarm.json | |
| sleep 1 | |
| swarm start mb | |
| sleep 1 | |
| swarm status mb |