This file contains 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 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 "cevaris@gmail.com" | |
# Prepwork | |
RUN apt-get -y -q update \ | |
&& apt-get -y -q install wget curl | |
This file contains 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 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 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
;; ispell | |
(dolist (hook '(text-mode-hook)) | |
(add-hook hook (lambda () (flyspell-mode 1)))) | |
(setq ispell-program-name "/usr/local/Cellar/ispell/3.3.02/bin/ispell") |
This file contains 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
When starting a project that includes refinerycms-blog: | |
$ rake refinery:override view=refinery/pages/* | |
$ rake refinery:override view=layouts/* | |
$ rake refinery:override view=refinery/blog/shared/* | |
$ rake refinery:override view=refinery/blog/posts/* | |
$ rake refinery:override view=refinery/* | |
$ rake refinery:override controller=refinery/blog/* | |
$ rake refinery:override controller=refinery/* |
This file contains 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
// Here You can type your custom JavaScript... | |
// Get a list of elements on the page. | |
var x = document.getElementsByTagName("*"); | |
// Go through each element and check for the accessKey property. | |
// Obliterate it if found. | |
for (var i = 0; i < x.length; i++) | |
{ | |
if(x[i].accessKey) | |
{ |
This file contains 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 zsh | |
# or #!/usr/bin/env bash | |
function rvm_init(){ | |
RVM_VERSION=$(echo $MY_RUBY_HOME | awk -F'-' '{print $2}') | |
RVM_GEMSET=$(basename $(PWD)) | |
for i in "$@" | |
do |
This file contains 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
scala> (0 until 10).foldRight(1)((a, z) => {println(s"$a,$z"); a}) | |
9,1 | |
8,9 | |
7,8 | |
6,7 | |
5,6 | |
4,5 | |
3,4 | |
2,3 | |
1,2 |
This file contains 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.nam.thrift.integration; | |
import junit.framework.TestCase; | |
import org.apache.thrift.TProcessor; | |
import org.apache.thrift.server.TServer; | |
import org.apache.thrift.server.TSimpleServer; | |
import org.apache.thrift.transport.TServerSocket; | |
import java.net.ServerSocket; |
OlderNewer