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/sh | |
| # Requires `jq` | |
| searchEC2 () { | |
| aws ec2 describe-instances | | |
| jq ".Reservations [].Instances[0] | | |
| select(contains({Tags: [{Value: \"$1\", Key: \"Name\"}], State: {Name: \"running\"}}))" | |
| } |
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/sh | |
| # Requires `jq` | |
| searchLogs() { | |
| USER=$2 | |
| PASSWORD=$3 | |
| ORG=$4 | |
| MSG_ID="$(perl -MURI::Escape -e 'print uri_escape($ARGV[0]);' "$1")" | |
| RSID=$(curl -s -u $USER:$PASSWORD "https://$ORG.loggly.com/apiv2/search?q=$MSG_ID&from=-9h&until=now&size=30" | jq -r '.rsid.id' 2>/dev/null) | |
| sleep 5 |
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/sh | |
| killSBT() { | |
| SBT_PID=$(jps | grep sbt-launch | awk '{print $1}') | |
| if [ -z "$SBT_PID" ] | |
| then | |
| echo SBT session not found | |
| else | |
| echo Killing SBT: $SBT_PID && kill -9 $SBT_PID | |
| 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
| package com.xdotai | |
| import shapeless._ | |
| import shapeless.ops.hlist.{Prepend, Align, Remove} | |
| object TypedPipelineComposition { | |
| import ShapelessExt._ | |
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
| sealed trait MyOption[+A] { | |
| def map[B](f: A => B): MyOption[B] = this match { | |
| case MySome(a) => MySome(f(a)) | |
| case MyNone => MyNone | |
| } | |
| def flatMap[B](f: A => MyOption[B]): MyOption[B] = this match { | |
| case MySome(a) => f(a) | |
| case MyNone => MyNone | |
| } |
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
| {-# LANGUAGE OverloadedStrings #-} | |
| import Network.URI | |
| import Network.HTTP | |
| import Network.Curl | |
| import Control.Monad.Maybe | |
| import Control.Applicative | |
| import Control.Monad.Trans | |
| import Text.CSV | |
| import Data.Time.Clock.POSIX |
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 Board < Array | |
| attr_reader :height, :width | |
| attr_accessor :occupied | |
| # The convention is (row, col) | |
| def initialize(width, height, occupied = []) | |
| @height, @width = height, width | |
| @occupied = occupied | |
| board= [] |
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 'rubygems' | |
| require 'ffi-ncurses' | |
| require 'twitter' | |
| require 'yaml' | |
| require 'singleton' | |
| module WorkingTitle | |
| class AuthStore | |
| include Singleton |
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
| #!/usr/bin/env ruby | |
| # | |
| require 'rubygems' | |
| require 'net/ssh' | |
| require 'net/ssh/proxy/http' | |
| local_host = "localhost" | |
| local_port = "5444" | |
| username = "test" |
NewerOlder