Skip to content

Instantly share code, notes, and snippets.

View dcalacci's full-sized avatar
🦩
wfh baby

Dana Calacci dcalacci

🦩
wfh baby
View GitHub Profile
@agnoster
agnoster / README.md
Last active May 6, 2025 18:36
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@ngauthier
ngauthier / README.md
Created July 5, 2012 20:10
Rdio "native" in linux

I like Rdio and linux. Rdio works great in a browser except for one thing: keyboard shortcuts!!!

When coding, I like to be able to play/pause my music quickly, meaning I don't want to switch windows. I figured out a way to do this:

Google Chrome --app

First, I made a file in my ~/bin called rdio that runs:

google-chrome --app=http://rdio.com
@tobyhede
tobyhede / postsql.sql
Created May 17, 2012 03:08
PostgreSQL as JSON Document Store
-- PostgreSQL 9.2 beta (for the new JSON datatype)
-- You can actually use an earlier version and a TEXT type too
-- PL/V8 http://code.google.com/p/plv8js/wiki/PLV8
-- Inspired by
-- http://people.planetpostgresql.org/andrew/index.php?/archives/249-Using-PLV8-to-index-JSON.html
-- http://ssql-pgaustin.herokuapp.com/#1
-- JSON Types need to be mapped into corresponding PG types
--
@chengjun
chengjun / mixing_matrix.R
Created April 18, 2012 01:43 — forked from gweissman/mixing_matrix.R
Calculate mixing matrix in igraph by vertex characteristic
# calculate the mixing matrix of in igraph graph object 'mygraph', by some vertex attribute 'attrib'
# can change the default use.density=FALSE to return a matrix with raw number of edges rather than density
mixmat <- function(mygraph, attrib, use.density=TRUE) {
require(igraph)
# get unique list of characteristics of the attribute
attlist <- sort(unique(get.vertex.attribute(mygraph,attrib)))
@prellele
prellele / gist:1825744
Created February 14, 2012 10:48
Using StartSSL Certs with Nginx-Webserver

NOTE: You can check, if your config here:
http://www.sslshopper.com/ssl-checker.html

Decrypt the private key using the password you entered when you created your key:
openssl rsa -in ssl.key -out /etc/nginx/conf/ssl.key

Protect your key from prying eyes:
chmod 600 /etc/nginx/conf/ssl.key

@HenrikJoreteg
HenrikJoreteg / straight_include.py
Created December 15, 2010 16:06
A Django Template tag for including files that you don't want to parse as templates
"""
Straight Include template tag by @HenrikJoreteg
Django templates don't give us any way to escape template tags.
So if you ever need to include client side templates for ICanHaz.js (or anything else that
may confuse django's templating engine) You can is this little snippet.
Just use it as you would a normal {% include %} tag. It just won't process the included text.
@TomK32
TomK32 / gist:164138
Last active November 13, 2015 05:24
ant dna
example map for
strenght: .AG. GC.. ...A ..GC | AC.. GT.. T.TC ....
size: CG.. .... ...C ..T. | ..AC .... ...C ..A.
ant 1: TTTC AAAG GGGG GAGC TGTA AGGA TTCT CCAG
ant 2: CCGC GGGC AGGT TTAC TACT TGGA TACC ACTC
Then we match each gene in strength and size against the ant unless it's a '.'
If we have match the score is increased. If we have a similarity (A<->G or C<->T)
the score is not changed and otherwise it's decreased.
@TomK32
TomK32 / gist:164135
Created August 7, 2009 20:04
ant dna skill-processor
# computed sample at https://gist.github.com/164138
genes = %w(A C G T)
strength = ".AG. GC.. ...A ..GC AC.. GT.. T.TC ...."
size = "CG.. .... ...C ..T. ..AC .... ...C ..A."
weight = "TC.C C... ..CG TG.C .... GC.A .GG. .AAA"
ant = ''
(0..31).each do |i|
ant += genes[rand(4)]