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 -o errexit -o pipefail -o nounset | |
cat_bundle () { | |
local file="$1" | |
echo "" | |
echo "" | |
echo "; ----------------------------------------------------------------------" | |
echo "; $(basename $file)" | |
echo "; ----------------------------------------------------------------------" |
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
import Control.Applicative | |
import Control.Concurrent.Chan (Chan, newChan) | |
import qualified Data.Map as M | |
import Control.Concurrent.STM (atomically, TVar, readTVar, writeTVar) | |
import Control.Monad.Trans | |
type Id = Integer | |
getOrCreateChannel :: (MonadIO m) => Id -> TVar (M.Map Id (Chan a)) -> m (Chan a) | |
getOrCreateChannel cid t = liftIO $ do |
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
# Connects to the server and removes all non-default DBs and users. | |
function clear_server { | |
lockdown_server | |
local dbs=( $( as_postgres psql -Atc \ | |
"SELECT datname FROM pg_catalog.pg_database | |
WHERE NOT datname | |
IN ('postgres','template0','template1')" ) ) | |
local users=( $( as_postgres psql -Atc \ | |
"SELECT rolname FROM pg_catalog.pg_roles | |
WHERE rolname != 'postgres';" ) ) |
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
PATH=/usr/sbin | |
45 * * * * networksetup -setairportpower en0 off && networksetup -setairportpower en0 on |
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 http://a.b.c/%20?x=4 { echo x ;} | |
:; http://a.b.c/%20?x=4 | |
x |
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
import org.scalatra._ | |
import org.eclipse.jetty.server.Server | |
import org.eclipse.jetty.webapp.WebAppContext | |
object Go { | |
def main(args: Array[String]) { | |
val server = new Server(8080) | |
val context = new WebAppContext() | |
context.setContextPath("/") | |
context.addServlet(classOf[Slash], "/*") |
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 -o errexit -o nounset -o pipefail | |
function -h { | |
cat <<USAGE | |
USAGE: memusg COMMAND [ARGS] | |
Measure memory usage of processes. | |
This script is inspired by a script of the same name written by Jaeho Shin | |
<[email protected]>. |
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
require 'formula' | |
class Mesos < Formula | |
homepage 'http://incubator.apache.org/mesos/' | |
head 'https://git-wip-us.apache.org/repos/asf/mesos.git' | |
depends_on 'autoconf' => :build | |
depends_on 'automake' => :build | |
depends_on 'libtool' => :build | |
depends_on 'zookeeper' |
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
class MOTD { | |
@JsonProperty | |
@Length(min=8, max=128, message = "The message mustn't be too short or long.") | |
var message : String = "Hello World" | |
} | |
@Path("motd") | |
class Endpoint { | |
@GET @Timed @Produces(Array(MediaType.TEXT_PLAIN)) | |
def get = Main.get |
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
Hat der alte Hexenmeister The old wizard has | |
Sich doch einmal wegbegeben! made away with himself for once! | |
Und nun sollen seine Geister And now shall his spirits | |
Auch nach meinem Willen leben. live according to my will! | |
Seine Wort und Werke His words and motions | |
Merkt ich und den Brauch, I have marked, and the usage, | |
Und mit Geistesstärke and with supernatural power | |
Tu ich Wunder auch. I can perform wonders. | |
Walle! walle March, march |