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 random | |
| import objgraph | |
| from pympler import muppy, summary | |
| import types | |
| import logging | |
| logging.basicConfig(level=logging.DEBUG) | |
| class Dumb(object): |
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 | |
| export KUBERNETES_PROVIDER=aws | |
| export KUBE_AWS_ZONE="ap-northeast-1c" | |
| export NUM_NODES=2 | |
| export MASTER_SIZE="t2.micro" | |
| export NODE_SIZE="t2.micro" | |
| export AWS_S3_REGION="ap-northeast-1" | |
| export AWS_S3_BUCKET=k8stmp | |
| export INSTANCE_PREFIX=k8s |
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 fabric.api import local, cd, run, env, sudo | |
| #env.ssh_config_path= | |
| env.use_ssh_config = True | |
| def dummy(): | |
| commands = [ | |
| 'pstree -a', |
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 | |
| CMD=$(basename ${0}) | |
| GREP=/bin/grep | |
| RC=$HOME/.bashrc | |
| VIMRC=$HOME/.vimrc | |
| TMP=$HOME/tmp | |
| VENV_PYTHON_VERSION="2.7.12" | |
| VENV_PYTHON3_VERSION="3.5.2" |
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 A | |
| class B extends Serializable | |
| val baos = new java.io.ByteArrayOutputStream(1024) | |
| val oos = new java.io.ObjectOutputStream(baos) | |
| val streamSurprise: Seq[A] = Stream.fill(3)(new A) // say you don't know it's a Stream under the covers | |
| val transformation = streamSurprise map (a => new B) | |
| oos.writeObject(transformation) // fails due to NotSerializableException: A |
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 client | |
| package client | |
| import java.time.Instant | |
| import java.util.Properties | |
| import java.util.concurrent.{Future => JF, TimeoutException, Executors} | |
| import grizzled.slf4j.Logger |
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
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 Data.Char | |
| import Control.Monad | |
| import Control.Monad.Trans.State.Lazy (StateT(..), runStateT) | |
| import Control.Monad.Trans.Reader | |
| import Control.Monad.State.Class | |
| import Control.Monad.Trans.Class | |
| type Pos = (Int, Int) -- (line, column) | |
| type PString = (Pos, 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
| {-# LANGUAGE DeriveDataTypeable #-} | |
| module KSSolver where | |
| import System.Console.CmdArgs | |
| import System.IO | |
| import Control.Monad | |
| import Control.Applicative | |
| import Data.Vector (Vector, (!)) | |
| import qualified Data.Vector as V | |
| import Debug.Trace |
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 scala.language.higherKinds | |
| import scala.annotation.unchecked.uncheckedVariance | |
| trait Budr[-Elm, +To] { | |
| def +=(elem: Elm): this.type | |
| def result(): To | |
| def mapResult[NewTo](f: To => NewTo): Budr[Elm, NewTo] = { | |
| new Budr[Elm, NewTo] with Proxy { | |
| val self = Budr.this | |
| def +=(x: Elm): this.type = { self += x; this } |