Skip to content

Instantly share code, notes, and snippets.

View jmatt's full-sized avatar

JMatt Peterson jmatt

View GitHub Profile

conda/el5 docker container -- dev branch

docker pull lsstsqre/centos:5-conda-base
docker run -ti lsstsqre/centos:5-conda-base bash

git clone https://github.com/jhoblitt/conda-lsst.git -b dev
cd conda-lsst
./bin/bootstrap.sh
export PATH="$PWD/miniconda/bin:$PATH"
@jmatt
jmatt / convert-lfs.sh
Last active November 17, 2015 22:54 — forked from jhoblitt/convert-lfs.sh
This script was used to migrate from gitosis to https://github.com/lsst/afwdata
# converting an existing repo to use "lfs"
#
# note that a .gitattributes file for lfs needs to be added to any commit in
# which large files are present in the tree
wget http://repo1.maven.org/maven2/com/madgag/bfg/1.12.7/bfg-1.12.7.jar -O bfg-1.12.7.jar
git clone --mirror git://git.lsstcorp.org/LSST/DMS/testdata/afwdata.git afwdata
cd afwdata
java -jar ../bfg-1.12.7.jar --convert-to-git-lfs '*.{boost,dat,fits,gz}' --no-blob-protection
git reset --hard
@jmatt
jmatt / .tmux.conf
Created May 10, 2013 05:02
tmux configuration.
#Resize on every detach (Useful on multiple sessions)
set-window-option -g aggressive-resize on
# Set the base index for windows to 1 instead of 0
set -g base-index 1
# # Set the base index for panes to 1 instead of 0
setw -g pane-base-index 1
# Set status bar
@shanselman
shanselman / gist:5422230
Last active March 28, 2024 10:33
Evil Blog Comment Spammer just exposed his template through some error and the whole thing showed up in my comments.
{
{I have|I've} been {surfing|browsing} online more than {three|3|2|4} hours today, yet I never found any interesting article like yours. {It's|It
is} pretty worth enough for me. {In my opinion|Personally|In my view}, if all {webmasters|site owners|website owners|web owners} and bloggers made good content as
you did, the {internet|net|web} will be {much more|a lot more}
useful than ever before.|
I {couldn't|could not} {resist|refrain from} commenting. {Very well|Perfectly|Well|Exceptionally well} written!|
{I will|I'll} {right away|immediately} {take hold of|grab|clutch|grasp|seize|snatch}
your {rss|rss feed} as I {can not|can't} {in finding|find|to find} your {email|e-mail} subscription {link|hyperlink} or {newsletter|e-newsletter} service. Do {you have|you've} any?
{Please|Kindly} {allow|permit|let} me {realize|recognize|understand|recognise|know} {so that|in order that} I {may just|may|could} subscribe.
Thanks.|
@jmatt
jmatt / init.el
Last active October 1, 2015 15:57
emacs24 setup.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; J. Matt Peterson's new emacs setup. ;;;;
;;;; https://gist.github.com/2019332 ;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(require 'hippie-exp)
;;; Setup PATH environment.
(setenv "PATH"
(concat
@odyssomay
odyssomay / gist:1035590
Created June 20, 2011 13:19
Macro to create a callable record with any arity
(defmacro definvokerecord [invoke_fn & body]
`(defrecord
~@body
clojure.lang.IFn
~@(map (fn [n]
(let [args (for [i (range n)] (symbol (str "arg" i)))]
(if (empty? args)
`(~'invoke [this#]
(~invoke_fn this#))
`(~'invoke [this# ~@args]
@weavejester
weavejester / gist:1001206
Created May 31, 2011 20:27
Clojure on Heroku
~/$ lein new ring-on-heroku
Created new project in: /home/jim/Development/ring-on-heroku
~/$ cd ring-on-heroku
~/ring-on-heroku$ echo 'web: lein run -m ring-on-heroku.core' > Procfile
~/ring-on-heroku$ cat > src/ring_on_heroku/core.clj
(ns ring-on-heroku.core
(:use ring.util.response
ring.adapter.jetty))
(defn app [req]
@ossareh
ossareh / why_clojure_rawks.clj
Created January 5, 2011 23:16
transform ratios to map and back again
(defmulti transform-ratio
"Transforms Ratios to and from maps. Passes other values through without changing them unless they are of type clojure.lang.Ratio or clojure.lang.PersistenArrayMap. In the case of a map they must be annotated with :t \"ratio\" otherwise they'll get passed through too"
class)
(defmethod transform-ratio :default [v] v)
(defmethod transform-ratio clojure.lang.Ratio [value]
{:n (numerator value)
:d (denominator value)
@tessro
tessro / redis-server
Created December 16, 2009 14:20
A CentOS initscript for Redis
#!/bin/sh
#
# redis - this script starts and stops the redis-server daemon
#
# chkconfig: - 85 15
# description: Redis is a persistent key-value database
# processname: redis-server
# config: /etc/redis/redis.conf
# config: /etc/sysconfig/redis
# pidfile: /var/run/redis.pid