Skip to content

Instantly share code, notes, and snippets.

@gensym
gensym / discourse-postgres-update.md
Last active October 27, 2018 15:25 — forked from kmarcisz/easel-postgres-update.md
discourse-postgres-update.md

Note that all commands should be run locally unless otherwise noted.

Put discourse into readonly mode: https://discuss.inventables.com/admin/backups

Take a database snapshot

aws rds create-db-snapshot \
    --db-snapshot-identifier discourse-postgres-upgrade \
@gensym
gensym / chat-frontend.js
Created August 5, 2016 14:41 — forked from martinsik/chat-frontend.js
Node.js chat frontend and server
$(function () {
"use strict";
// for better performance - to avoid searching in DOM
var content = $('#content');
var input = $('#input');
var status = $('#status');
// my color assigned by the server
var myColor = false;
@gensym
gensym / gist:6431963
Created September 4, 2013 01:58
Lazy primes
((fn primeseq [candidates]
(let [p (first candidates)]
(cons p
(lazy-seq (primeseq
(filter
#(not (zero? (mod % p)))
(rest candidates)))))))
(iterate inc 2))
source ~/.git-completion.sh
alias gco='git co'
alias gci='git ci'
alias grb='git rb'
@gensym
gensym / profile.sh
Created January 29, 2009 00:35 — forked from jemmons/#dotfiles
export PATH=/opt/local/bin:/opt/local/sbin:/opt/local/lib/postgresql83/bin:$PATH
export EDITOR="/usr/bin/mate -w"
alias dbstart='sudo /opt/local/etc/LaunchDaemons/org.macports.postgresql83-server/postgresql83-server.wrapper start'
alias dbstop='sudo /opt/local/etc/LaunchDaemons/org.macports.postgresql83-server/postgresql83-server.wrapper stop'
alias ss='script/server'
alias av='git branch -av'
alias gs='git status'
alias gc='git checkout'