Skip to content

Instantly share code, notes, and snippets.

@swannodette
swannodette / gist:3217582
Created July 31, 2012 14:52
sudoku_compact.clj
;; based on core.logic 0.8-alpha2 or core.logic master branch
(ns sudoku
(:refer-clojure :exclude [==])
(:use clojure.core.logic))
(defn get-square [rows x y]
(for [x (range x (+ x 3))
y (range y (+ y 3))]
(get-in rows [x y])))
@subelsky
subelsky / imagemagick_snippets.sh
Created August 20, 2012 14:45
Useful ImageMagick snippets
# Flatten a transparent image with a white background:
convert -flatten img1.png img1-white.png
# Make an image transparent
convert -transparent '#FFFFFF' nontransparent.gif transparent.png
# convert an image into tiles
convert -size 3200x3200 tile:single_tile.png final.png
# making a montage from a collection of images
@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007
@deekayen
deekayen / 1-1000.txt
Last active February 12, 2025 09:22
1,000 most common US English words
the
of
to
and
a
in
is
it
you
that
@baudehlo
baudehlo / gist:4229099
Created December 6, 2012 22:33
Apache James 2.3.2 vs Apache James 3.0.0beta4 vs Haraka 2.0.2 vs Postfix
Apache James 2.3.2, delivering to a local user, default setup
$ time /usr/libexec/postfix/smtp-source -c -l 5000 -t testuser@localhost -s 100 -m 10000 127.0.0.1:25
10000
real 1m5.751s
user 0m0.630s
sys 0m1.945s
@ndarville
ndarville / business-models.md
Last active February 27, 2025 10:00
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@jterrace
jterrace / git-annex-gcs.sh
Last active September 8, 2021 22:09
An example of how to use Google Cloud Storage with git-annex
# Initialize git and git-annex
$ mkdir annex-gcs-test
$ cd annex-gcs-test/
$ git init
Initialized empty Git repository in /Users/jterrace/annex-gcs-test/.git/
$ git annex init "my machine"
init my machine ok
(Recording state in git...)
# Set up AWS credentials
(defn sorted-key-list
[& maps]
(or
(->>
(mapcat keys maps)
set
(map str)
sort
(clojure.string/join ", ")
not-empty)
@jsl
jsl / clj-yaml-test.clj
Last active December 12, 2015 02:29
clj-yaml deserializes into arbitrary data types
;; Clojure library clj-yaml deserializes into arbitrary Java classes
user=> (require '[clj-yaml.core :as yaml])
nil
user=> (yaml/parse-string "!!java.io.File")
#<File >
@avescodes
avescodes / Editing Clojure with Emacs
Last active July 5, 2022 13:32
Get started editing Clojure in Emacs with this basic config.
Check out README.md to get started editing Clojure with Emacs.