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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Domains</key> | |
<dict> | |
<key>Applications</key> | |
<true/> | |
<key>Printing</key> | |
<true/> |
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
%lex | |
%% | |
\s+ /* skip whitespace */ | |
\n+ /* skip whitespace */ | |
[0-9]+ return 'NUMBER' | |
"->" return 'MAP' | |
"=?" return 'FILTER' | |
"$" return 'REDUCE' | |
"*" return '*' |
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
{:user {:dependencies [[org.clojure/tools.namespace "0.2.3"] | |
[spyscope "0.1.3"] | |
[criterium "0.4.1"]] | |
:injections [(require '(clojure.tools.namespace repl find)) | |
; try/catch to workaround an issue where `lein repl` outside a project dir | |
; will not load reader literal definitions correctly: | |
(try (require 'spyscope.core) | |
(catch RuntimeException e))] | |
:plugins [[lein-pprint "1.1.1"] | |
[lein-beanstalk "0.2.6"] |
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
(def 🔟 10) | |
(def 🚲 cycle) | |
(def ✊ take) | |
(def 🏁 (🚲 [:🚕 :🚗 :🚚 :🚒 :🚐])) | |
(✊ 🔟 🏁) |
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
require "formula" | |
class Flashrom < Formula | |
homepage "http://flashrom.org/" | |
url "http://download.flashrom.org/releases/flashrom-0.9.7.tar.bz2" | |
sha1 "d08b4073ea3ebf63f03c3e502f4291f50ef348ee" | |
head "svn://flashrom.org/flashrom/trunk", :using => :svn | |
depends_on 'libusb-compat' |
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
;; Anything you type in here will be executed | |
;; immediately with the results shown on the | |
;; right. | |
(import [com.pi4j.wiringpi Spi]) | |
(def reg {:no-op (byte 0x0) | |
:row-1 (byte 0x1) | |
:row-2 (byte 0x2) | |
:row-3 (byte 0x3) |
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 yathzee.core | |
(:require [clojure.set :refer :all])) | |
(defn- sum [list] | |
(reduce + list)) | |
(defn score-singles [num roll] | |
(sum (filter #(= num %) roll))) | |
(def score-1s (partial score-singles 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
;;; Kompiler og kjoer med: | |
;;; nasm -f elf64 -F stabs kake.asm && gcc -o kake kake.o && ./kake | |
global main | |
extern printf | |
segment .data | |
formatert db 'Svaret er: %u!', 0Ah, 0h | |
segment .text |
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
(fact (let [c (chan) | |
_ (>!! c :hallo)] | |
(deref (future (<!! c)) 200 :timeout) => :hallo)) |
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
;;; Concurrent prime sieve using core.async in clojure | |
(ns primesieve.core | |
(:require [clojure.core.async :as async :refer [go-loop chan >! <! <!! close! filter< to-chan]])) | |
(def bufsize 512) | |
(defn gen [upper-limit] | |
"Returns channel, puts numbers from 2 to upper-limit into channel" | |
(to-chan (range 2 upper-limit))) |