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 Y implements Comparable<X> { | |
int yTest; | |
@Override | |
public int compareTo(X o) { | |
if(this.yTest < o.xTest) return -1; | |
if(this.yTest > o.xTest) return 1; | |
return 0; | |
} |
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 ubuntu:12.04 | |
MAINTAINER Adam Cardenas "[email protected]" | |
# Prepwork | |
RUN apt-get -y -q update \ | |
&& apt-get -y -q install wget curl | |
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
# Grab the boot to docker ip address | |
function docker-ip() { | |
boot2docker ip 2> /dev/null | |
} | |
# SSH into a running container | |
# docker-ssh <CONTAINER_ID> | |
function docker-ssh() { | |
docker-setup | |
boot2docker ssh '[ -f /var/lib/boot2docker/nsenter ] || docker run --rm -v /var/lib/boot2docker/:/target jpetazzo/nsenter' |
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 main | |
// Run this in playground | |
// https://play.golang.org/p/k47thicjzn | |
import "fmt" | |
type Item struct { | |
a *Item | |
b 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
package main | |
import "fmt" | |
// Play | |
// http://play.golang.org/p/Hs59f-DNXp | |
func PrintAll(vals interface{}) { | |
switch v := vals.(type) { |
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 main | |
import "fmt" | |
type A struct { | |
a, b int | |
} | |
func MapStructValAsKey(){ | |
// Notice: We are using value of `A`, not `*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
#!/usr/bin/env bash | |
# Generate RSA private key | |
openssl genrsa -out private_key.pem 1024 |
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
go build -gcflags '-N' |
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
var EPSILON float64 = 0.00000001 | |
func floatEquals(a, b float64) bool { | |
if ((a - b) < EPSILON && (b - a) < EPSILON) { | |
return true | |
} | |
return false | |
} |
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
# Sample file | |
samplef() { | |
# set -x | |
if [ -z "${1}" ]; then | |
echo 'Error: Missing file path' | |
echo | |
echo 'Usage:' | |
echo 'samplef <FILEPATH> <SAMPLE_SIZE>' | |
echo | |
echo 'Optional paramters: <SAMPLE_SIZE>, default is 0.1' |
OlderNewer