This file contains hidden or 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
#!/bin/sh | |
# Ubuntu 12.04 | |
# sudo apt-get -y install p7zip-full genisoimage | |
wget http://www.tinycorelinux.net/4.x/x86/release/Core-current.iso | |
wget http://www.tinycorelinux.net/4.x/x86/release/distribution_files/core64.gz | |
wget http://www.tinycorelinux.net/4.x/x86/release/distribution_files/vmlinuz64 | |
# extract files | |
7z x Core-current.iso -ocore-current |
This file contains hidden or 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
require 'parslet' | |
class Parslet::Transform | |
def transform_elt(elt, context) # :nodoc: | |
rules.each do |pattern, block| | |
if bindings=pattern.match(elt, context) | |
# Produces transformed value | |
return call_on_match({:node => elt}.merge(bindings), block) | |
end | |
end |
This file contains hidden or 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
//Run this while at the main menu | |
WORDS={2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[],11:[],12:[]}; | |
var w = 'at el id on add cid get has off set url make save sort sync clear clone fetch model parse pluck reset route start unset create escape extend length models remove render router routes setdom tojson changed destroy emulate history isvalid library trigger urlroot defaults delegate getbycid navigate previous validate attributes collection comparator haschanged initialize noconflict setelement undelegate constructor idattribute' | |
.toLowerCase().split(' '); | |
for (var i = w.length - 1; i >= 0; i--) { if(w[i].length < 13 && w[i].length > 1) WORDS[w[i].length].push(w[i]); } |
This file contains hidden or 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
//Run this while at the main menu | |
ig.game.registerTarget=function(letter,ent){if(this.targets[letter]===undefined)this.targets[letter]=[];this.targets[letter].push(ent);}; | |
ig.game.unregisterTarget=function(letter,ent){(this.targets[letter]||[]).erase(ent);}; | |
window.removeEventListener('keydown',ig.game.keydown.bind(ig.game)); | |
ig.game.keydown=function (event){if(event.target.type=='text'||event.ctrlKey||event.altKey||this.mode!=ZType.MODE.GAME||this.menu){return true;}var c=event.which;if(c==189)c=45;if(event.shiftKey&&c==191)c=63;if(event.shiftKey&&c==56)c=42;if(event.shiftKey&&c==49)c=33;if(c==187)c=61;if(!((c>64&&c<91)||(c>96&&c<123)||(c==45||c==33||c==63||c==42||c==61))||c==16){return true;} event.stopPropagation();event.preventDefault();var letter=String.fromCharCode(c).toLowerCase();if(!this.currentTarget){var potentialTargets=this.targets[letter];var nearestDistance=-1;var nearestTarget=null;for(var i=0;i<potentialTargets.length;i++){var distance=this.player.distanceTo(potentialTargets[i]);if(distance<n |
This file contains hidden or 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
;[org.jodd/jodd-lagarto "3.4.2"] | |
;(:import [jodd.csselly CSSelly CssSelector Combinator Selector$Type]) | |
(defn format-attr-selector [x] | |
(case (.getName x) | |
"id" (str "#" (.getValue x)) | |
"class" (str "." (.getValue x)) | |
"")) | |
(defn format-selector [x] |
This file contains hidden or 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
(def closing {\) \( | |
\} \{ | |
\] \[}) | |
(def opening [\( \{ \[]) | |
(defn zero-or-more [x] (if (>= x 0) x 0)) | |
(defn indent-exception? [[a b]] (not (and (= a \') (= b \()))) | |
; warning: Very basic clojure language parsing. It does not handle strings. | |
(defn reverse-parse | |
([data] (reverse-parse data [])) |
This file contains hidden or 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 test1 | |
(:require [instaparse.core :as insta] | |
[net.cgrand.enlive-html :as enlive] | |
[clojure.walk :as walk])) | |
(defn render [nodes] | |
(walk/postwalk #(if (and (map? %) (:tag %)) | |
(with-meta (hash-map (:tag %) (:content %)) (:attrs %)) | |
%) nodes)) |
This file contains hidden or 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 gittree.TreeIterator | |
(:import [org.eclipse.jgit.lib Repository FileMode] | |
[org.eclipse.jgit.treewalk WorkingTreeIterator WorkingTreeIterator$Entry WorkingTreeOptions] | |
[java.io ByteArrayInputStream]) | |
(:gen-class :extends org.eclipse.jgit.treewalk.WorkingTreeIterator | |
:init init2 | |
:post-init postinit | |
:state state | |
:constructors {[org.eclipse.jgit.lib.Repository Object] [org.eclipse.jgit.treewalk.WorkingTreeOptions] | |
[org.eclipse.jgit.lib.Repository Object org.eclipse.jgit.treewalk.WorkingTreeIterator] [org.eclipse.jgit.treewalk.WorkingTreeIterator]})) |
This file contains hidden or 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 async1 | |
(:require [clojure.core.async :as async])) | |
(defn alice [c] | |
(async/>!! c "Carol Carolson's House @ 10pm")) | |
(defn bob [c] | |
(async/go (println "Bob received: " (async/<! c)))) | |
(let [phonenumber-555-555-9292 (async/chan)] |
This file contains hidden or 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 async2 | |
(:require [clojure.core.async :as async] | |
[clojure.core.async.lab :as lab])) | |
(defn make-fb-group [& members] | |
(apply lab/broadcast members)) | |
(defn alice [c] | |
(async/>!! c "Dave Davenson's House @ 10pm")) |
OlderNewer