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
public class Main { | |
static class A { | |
public void foo() { | |
System.out.println("foo - A"); | |
} | |
public void bar() { | |
System.out.println("bar - A"); | |
} |
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
import com.memetix.mst.language.Language; | |
import com.memetix.mst.translate.Translate; | |
public class ExampleTranslation { | |
public static void main(String[] args) throws Exception { | |
//Replace client_id and client_secret with your own. | |
Translate.setClientId("CLIENT_ID_HERE"); | |
Translate.setClientSecret("CLIENT_SECRET_HERE"); | |
// Translate an english string to spanish |
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
import java.io.InputStreamReader; | |
import java.net.URI; | |
import java.util.List; | |
import com.google.common.base.Charsets; | |
import com.google.common.collect.Lists; | |
import com.google.common.io.CharStreams; | |
import org.apache.http.HttpResponse; | |
import org.apache.http.NameValuePair; |
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
# Add alias to bash shell | |
echo "alias json='python -mjson.tool'" >> ~/.bashrc | |
# Add alias for zsh shell | |
echo "alias json='python -mjson.tool'" >> ~/.zshrc |
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
# 1- Make sure you have node installed | |
brew install node | |
# 2- install prettyjson as a global package | |
sudo npm install -g prettyjson |
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
% echo "{\"array\":[1,2,3],\"boolean\":true}" | json | |
{ | |
"array": [ | |
1, | |
2, | |
3 | |
], | |
"boolean": true | |
} |
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.phyous.leap | |
import java.io.IOException | |
import com.leapmotion.leap._ | |
object App { | |
def main(args: Array[String]) { | |
val listener = new SampleListener | |
val controller = new Controller |
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.phyous.leap | |
import java.io.IOException | |
import java.lang.Math | |
import com.leapmotion.leap._ | |
import com.leapmotion.leap.Gesture.State | |
class SampleListener extends Listener { | |
override def onInit(controller: Controller) { |
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 ruby | |
# remove names from file1 contained in file2 | |
unique_entries = File.readlines(ARGV[0]) - File.readlines(ARGV[1]) | |
unique_entries.each{|l| puts l} |
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
import sbt._ | |
import Keys._ | |
import play.Project._ | |
object ApplicationBuild extends Build { | |
val appName = "chain-mail" | |
val appVersion = "1.0-SNAPSHOT" | |
val appDependencies = Seq( |