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
# IP2Location you can get from http://www.ip2location.com/ruby.aspx | |
require 'IP2Location' | |
locator = IP2Location.new | |
locator.open("./IP-COUNTRY-REGION-CITY-LATITUDE-LONGITUDE.BIN") |
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
lein new awesomeness | |
cd awesomeness |
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
(defproject awesomeness "0.1.0-SNAPSHOT" | |
; ... | |
:jvm-opts ["-Dphantomjs.binary.path=./phantomjs-1.9.1-linux-x86_64/bin/phantomjs"] | |
:dependencies [[org.clojure/clojure "1.5.1"] | |
[clj-webdriver/clj-webdriver "0.6.0"] | |
[com.github.detro.ghostdriver/phantomjsdriver "1.0.3"]]) |
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
curl https://phantomjs.googlecode.com/files/phantomjs-1.9.1-linux-x86_64.tar.bz2 | tar xvj |
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
lein deps |
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
lein repl |
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 jvmjit; | |
public class JvmJit { | |
static long startTime = System.nanoTime(); | |
public static void main(String[] args) { | |
Test0 me = new Test0(); | |
while (true) { | |
me.runHello(); | |
} |
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
lein new rock-paper-scissors | |
cd rock-paper-scissors/ |
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
(defproject rock-paper-scissors "0.1.0-SNAPSHOT" | |
; ... | |
:dependencies [[org.clojure/clojure "1.5.1"] | |
[org.clojure/core.logic "0.8.3"]]) |
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
(ns rock-paper-scissors.core | |
(:refer-clojure :exclude [==]) | |
(:use clojure.core.logic)) | |
(defrel beats hand1 hand2) | |
(facts beats [[:rock :scissor] [:paper :rock] [:scissor :paper]]) | |
(defn play [hand1 hand2] | |
(run* [result] | |
(conde |
OlderNewer