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
(defn hiccup-zip | |
"Returns a zipper for hiccup" | |
[root] | |
(zip/zipper | |
; branch? | |
(fn [x] (and (vector? x) | |
(not (empty? x)) | |
(keyword? (first x)))) | |
; children | |
(fn [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
(defun let-me-google-that-for-you (beg end) | |
(interactive "r") | |
(kill-new (format "http://lmgtfy.com/?q=%s" (url-hexify-string (buffer-substring beg 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
;;; thumb-through.el --- Plain text reader of HTML documents | |
;; Copyright (C) 2010 Andrew Gwozdziewycz <[email protected]> | |
;; Version: 0.1 | |
;; Keywords: html | |
;; This file is NOT part of GNU Emacs | |
;; This is free software; you can redistribute it and/or modify it under |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
""" | |
Lingua::EN::Syllable::syllable() estimates the number of syllables in | |
the word passed to it. | |
Note that it isn't entirely accurate... it fails (by one syllable) for | |
about 10-15% of my /usr/dict/words. The only way to get a 100% accurate | |
count is to do a dictionary lookup, so this is a small and fast alternative | |
where more-or-less accurate results will suffice, such as estimating the |
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
;; Lingua::EN::Syllable::syllable() estimates the number of syllables in | |
;; the word passed to it. | |
;; Note that it isn't entirely accurate... it fails (by one syllable) for | |
;; about 10-15% of my /usr/dict/words. The only way to get a 100% accurate | |
;; count is to do a dictionary lookup, so this is a small and fast alternative | |
;; where more-or-less accurate results will suffice, such as estimating the | |
;; reading level of a document. | |
;; I welcome pointers to more accurate algorithms, since this one is |
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
;;;; Conway's game of life | |
;;; certainly not the best implementation, but it works... | |
(ns life.core | |
(:import (java.awt Color Dimension) | |
(javax.swing JPanel JFrame Timer JOptionPane) | |
(java.awt.event ActionListener KeyListener))) | |
(def width 50) | |
(def height 50) |
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 dummy.core | |
:use [[clojure.contrib.seq-utils :only [indexed]]]) | |
(defn find-all | |
[coll x] | |
(keep-indexed #(if (= x %2) %1) coll)) | |
(defn merge-left-row [coll idx] | |
(let [front (map second | |
(filter #(not (contains? idx (first %))) |
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 samegame | |
(:use [clojure.set :only (union)] | |
[clojure.contrib.math :only (floor)] | |
[clojure.contrib.seq-utils :only (indexed)]) | |
(:import (java.awt Color Dimension) | |
(javax.swing JPanel JFrame Timer JOptionPane) | |
(java.awt.event ActionListener KeyListener MouseListener))) | |
(def colors [(Color. 255 0 0) (Color. 0 255 0) (Color. 0 0 255)]) | |
(def blank-color (Color. 0 0 0)) |
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
By Shriram Krishnamurthi | |
Posted to comp.lang.scheme on January 17, 1996, for Scheme's twentieth | |
birthday: | |
((I m a g i n e) | |
([email protected]) | |
(((Imagine there's no FORTRAN) | |
(It's easy if you try) | |
(No SML below us) (Above us only Y) |
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
One day I got bored of Java. So I learned a little Lisp and what I | |
found was a surprise (the land of lisp): It is the language so unique | |
and so expressive, so that coding never looks the same within my eyes. | |
Now I eat parentheses for breakfast. And if my program isn't done, I | |
eat parentheses for lunch (the land of lisp). They might look funny | |
but they have semantic power, that gives your program lots of brevity | |
and punch! | |
Simple but refined guaranteed to blow your mind (the land of lisp). | |
Minimal and sleek, but still so clever you will freak (the land of |