Skip to content

Instantly share code, notes, and snippets.

@paulkoerbitz
paulkoerbitz / tutorial1.clj
Created October 18, 2011 11:35
Simple webscrape with enlive
(ns tutorial.scrape1
(:require [net.cgrand.enlive-html :as html]))
(def *url* "http://www.belex.rs/trgovanje/prospekt/VZAS/show")
(defn get-page
"Gets the html page from passed url"
[url]
(html/html-resource (java.net.URL. url)))
@viksit
viksit / uuid.js
Created March 22, 2011 18:06
Javscript generate UUID/GUID
'xxyxxyxyx'.replace(/[xy]/g, function(c) {
var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);
return v.toString(16);
});
(ns shell
"Run OS commands"
(:import [java.io BufferedReader InputStreamReader]))
(defn run
"Executes the given command"
[cmd]
(.. Runtime getRuntime (exec (str cmd))))
(defn pipe-to