Skip to content

Instantly share code, notes, and snippets.

View arnar's full-sized avatar

Arnar Birgisson arnar

View GitHub Profile
CmdUtils.CreateCommand({
name: "jquery",
preview: "Injects the latest version of jQuery into the current page.",
execute: function() {
var s=Application.activeWindow.activeTab.document.createElement('script');
s.setAttribute('src','http://jquery.com/src/jquery-latest.js');
Application.activeWindow.activeTab.document.getElementsByTagName('body')[0].appendChild(s);
displayMessage( "jQuery injected in current page");
}
});
module Main where
import Data.Maybe (fromJust)
import Data.List (nub, intersect)
import Control.Monad.Writer
-- Modules in topological order, i.e.
-- a module must appear after all of its
-- dependencies
dependencies = [
module Main where
import Data.Maybe (fromJust)
import Data.List (nub, intersect)
import Control.Monad.Writer
-- Modules in topological order, i.e.
-- a module must appear after all of its
-- dependencies
dependencies = [
[81 of 86] Compiling Yi.UI.Vty ( Yi/UI/Vty.hs, dist/build/Yi/UI/Vty.o )
Yi/UI/Vty.hs:99:92:
Ambiguous occurrence `refresh'
It could refer to either `Yi.UI.Vty.refresh', defined at Yi/UI/Vty.hs:178:0
or `Vty.refresh', imported from Graphics.Vty at Yi/UI/Vty.hs:42:0-25
Yi/UI/Vty.hs:117:64:
Ambiguous occurrence `refresh'
It could refer to either `Yi.UI.Vty.refresh', defined at Yi/UI/Vty.hs:178:0
@arnar
arnar / gist:25774
Created November 17, 2008 14:16
Chord guesser for major keys
import re
NOTE_NUMBERS = {
'A': 0,
'A#': 1,
'Bb': 1,
'B': 2,
'C': 3,
'C#': 4,
'Db': 4,
(defstruct env
(width 2)
(height 1)
(x-pos 0)
(y-pos 0)
(dirt-vector (make-array 2))
(moves-so-far 0))
(defstruct agent
(name "A")
;; agents.lisp
(defstruct env
(width 2)
(height 1)
(x-pos 0)
(y-pos 0)
(dirt-vector (make-array 2))
(moves-so-far 0))
<html>
<body>
Does this work?
</body>
</html>
;; agents2.lisp
(defstruct env
(width 2)
(height 1)
(x-pos 0)
(y-pos 0)
(dirt-vector (make-array 2))
(moves-so-far 0))