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 | |
# Created by Sarat Pediredla | |
# Partner | |
# hedgehog lab | |
# | |
# NOTE: THIS SCRIPT IT TAILORED TO WORKING WITH MERCURIAL AND FIXX VERSION 1.7 | |
# | |
# INSTALLATION INSTRUCTIONS : | |
# |
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
;; this file is a walkthrough of Moustache features, a web framework for Clojure | |
;; http://github.com/cgrand/moustache/tree/master | |
;; Moustache allows to declare routes, apply middlewares and dispatch on http methods. | |
;; Moustache is compatible with all frameworks built on Ring, including Compojure | |
(ns demo | |
(:use net.cgrand.moustache) | |
(:use [ring.adapter.jetty :only [run-jetty]])) ;; hmmm Ring without servlets | |
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
val pattern = java.util.regex.Pattern.compile ("""(?xs) ("(.*?)"|) ; ("(.*?)"|) (?: \r?\n | \z ) """) | |
val matcher = pattern.matcher (input) | |
while (matcher.find) { | |
val col1 = matcher.group (2) | |
val col2 = matcher.group (4) | |
// ... | |
} |
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
// Inmperative version | |
// | |
def selectionSort(list: Array[Int]): Unit { | |
def swap(list: Array[Int], i: Int, j: Int) { | |
var tmp = list(i) | |
list(i) = list(j) | |
list(j) = tmp | |
} | |
var i = 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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'net/http' | |
require 'json' | |
http = Net::HTTP.new('stream.twitter.com', 80) | |
get = Net::HTTP::Get.new("/1/statuses/filter.json?track=awesome") | |
get.basic_auth ARGV[0], ARGV[1] |
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 net.experimentalworks.clojure.comp | |
(:use compojure)) | |
(defroutes helloworld-routes | |
(GET "/login/:user" | |
[(session-assoc :loggedin (:user params)) | |
(html [:html [:body [:p "You are now logged in as " (:user params)]]])]) | |
(GET "/*" | |
(if (contains? session :loggedin) | |
(html [:html [:body [:p "Welcome back " [:b (:loggedin session)]]]]) |
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
(defn set-log4j-level! [level] | |
"Sets the log4j root logger's level." | |
(let [root-logger (org.apache.log4j.Logger/getRootLogger)] | |
(.setLevel root-logger level))) | |
(defn set-log4j-to-debug! | |
[] | |
(set-log4j-level! org.apache.log4j.Level/DEBUG)) | |
(defn set-log4j-to-info! |
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_test() | |
{ | |
local curw | |
COMPREPLY=() | |
curw=${COMP_WORDS[COMP_CWORD]} | |
if [ -d test ]; then | |
COMPREPLY=($(compgen -W '$(cd test; find * -name \*.clj | sed "s/.clj\$//" | sed "s/_/-/g" | sed "s|/|.|g")' -- $curw)); | |
return 0 | |
fi | |
} |
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
<?php | |
/** | |
* UUID class | |
* | |
* The following class generates VALID RFC 4122 COMPLIANT | |
* Universally Unique IDentifiers (UUID) version 3, 4 and 5. | |
* | |
* UUIDs generated validates using OSSP UUID Tool, and output | |
* for named-based UUIDs are exactly the same. This is a pure | |
* PHP implementation. |
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
README.html |
OlderNewer