Skip to content

Instantly share code, notes, and snippets.

@bendlas
bendlas / select.clj
Last active December 13, 2015 16:48
This is a draft of the current production state of my clojurescript enlive port. From the other end, I'm factoring enlive, so that its engine can work on any tree. That should enable a lot of shared code between a clj and a cljs version.
;; The macros
;; most macros here alias names from select.cljs
;; they will get used in regular calls
(ns lib.select
(:require
[clojure.string :as str]))
;; selector syntax
(defn intersection [preds]
@webframp
webframp / erc-settings.el
Last active December 12, 2015 10:18
Working ERC settings used with IRCRelay. Securely stores password and provides growl notifications for mentions.
(require 'erc)
(require 'netrc)
(setq erc-user-full-name "Sean Escriva"
erc-part-reason-various-alist '(("^$" "Leaving"))
erc-quit-reason-various-alist '(("^$" "Leaving"))
erc-quit-reason 'erc-part-reason-various
erc-part-reason 'erc-quit-reason-various)
(add-hook 'erc-mode-hook (lambda () (auto-fill-mode 0)))
@peterdeweese
peterdeweese / gitflow-tutorial.sh
Created December 10, 2012 16:05
Gitflow Tutorial
set -o verbose
set -o errexit
echo '* Create and initialize a repository.'
git init gitflow-tutorial
cd gitflow-tutorial/
git flow init -d
echo '* Develop a Feature'
@quoll
quoll / mandelbrot.clj
Created November 17, 2012 18:51
Mandelbrot in Clojure using Java 2D
(ns test.mandelbrot
"Simple Mandelbrot generator.
Trying to optimize. Pulling apart math operations."
(:gen-class)
(:use [test.complex :only (abs2 times plus)])
(:import [test.complex Complex]
[java.awt Graphics Color Dimension]
[java.awt.event KeyListener KeyEvent]
[java.awt.image BufferedImage]
[javax.swing JPanel JFrame SwingUtilities]))
(use 'visaje.core)
(use 'vmfest.manager)
(def my-server (server "http://localhost:18083"))
(install-os my-server
{:name "debian-test"
:disk-location "/tmp/debian-test.vdi"
:disk-size (* 8 1024)
:os-iso-location
"/Volumes/DATA/ISOS/debian-6.0.2.1-amd64-netinst.iso"
@tbatchelli
tbatchelli / gist:4080635
Created November 15, 2012 19:25
proxy config for pallet-vmfest
{:provider "vmfest"
:environment{
:phases {:bootstrap
(fn [session]
(let [p (ns-resolve
'pallet.action.package 'package-manager)]
(->
session
(p :configure :proxy "http://10.0.2.2:3128"))))}
:proxy "http://10.0.2.2:3128"}}
@AvnerCohen
AvnerCohen / npm-cheat-sheet.md
Last active August 18, 2024 08:34
Node.js - npm Cheat Sheet

Node.js - npm Cheat Sheet

(Full description and list of commands at - https://npmjs.org/doc/index.html)

List of less common (however useful) NPM commands

Prepand ./bin to your $PATH

Make sure to export your local $PATH and prepand relative ./node_modules/.bin/:

@klange
klange / _.md
Last active December 23, 2024 14:40
It's a résumé, as a readable and compilable C source file. Since Hacker News got here, this has been updated to be most of my actual résumé. This isn't a serious document, just a concept to annoy people who talk about recruiting and the formats they accept résumés in. It's also relatively representative of my coding style.

Since this is on Hacker News and reddit...

  • No, I don't distribute my résumé like this. A friend of mine made a joke about me being the kind of person who would do this, so I did (the link on that page was added later). My actual résumé is a good bit crazier.
  • I apologize for the use of _t in my types. I spend a lot of time at a level where I can do that; "reserved for system libraries? I am the system libraries".
  • Since people kept complaining, I've fixed the assignments of string literals to non-const char *s.
  • My use of type * name, however, is entirely intentional.
  • If you're using an older compiler, you might have trouble with the anonymous unions and the designated initializers - I think gcc 4.4 requires some extra braces to get them working together. Anything reasonably recent should work fine. Clang and gcc (newer than 4.4, at le
@richhickey
richhickey / thread.clj
Created October 13, 2012 17:43
new thread macros draft
(defmacro test->
"Takes an expression and a set of test/form pairs. Threads expr (via ->)
through each form for which the corresponding test expression (not threaded) is true."
[expr
& clauses]
(assert (even? (count clauses)))
(let [g (gensym)
pstep (fn [[test step]] `(if ~test (-> ~g ~step) ~g))]
`(let [~g ~expr
~@(interleave (repeat g) (map pstep (partition 2 clauses)))]
@rafaelss
rafaelss / gist:3700977
Created September 11, 2012 19:04
PostgreSQL 9.2 upgrade steps
Steps to install and run PostgreSQL 9.2 using Homebrew (Mac OS X)
(if you aren't using version 9.1.5, change line 6 with the correct version)
1. pg_ctl -D /usr/local/var/postgres stop -s -m fast
2. mv /usr/local/var/postgres /usr/local/var/postgres91
3. curl https://raw.github.com/fragility/homebrew/737af01178590950749cf5e841f2d086c57c5a80/Library/Formula/postgresql.rb > /usr/local/Library/Formula/postgresql.rb
4. brew upgrade postgresql
5. initdb /usr/local/var/postgres -E utf8
6. pg_upgrade -b /usr/local/Cellar/postgresql/9.1.5/bin -B /usr/local/Cellar/postgresql/9.2.0/bin -d /usr/local/var/postgres91 -D /usr/local/var/postgres
7. pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start