Skip to content

Instantly share code, notes, and snippets.

View thirdknife's full-sized avatar

Shakeel thirdknife

  • Waterloo, Ontario
View GitHub Profile
@thirdknife
thirdknife / npm install on node v0.4.12
Created September 20, 2011 21:54
npm installation failed
/node$ sudo curl http://npmjs.org/install.sh | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 5100 100 5100 0 0 4100 0 0:00:01 0:00:01 --:--:-- 8793
fetching: http://registry.npmjs.org/npm/-/npm-1.0.30.tgz
0.4.12
1.0.30
cleanup prefix=/usr/local
All clean!
stdin: is not a tty
@thirdknife
thirdknife / pre-receive.sh
Created March 30, 2012 14:35
My pre-receive hook to update my website when I "git push origin master:live"
#!/bin/sh
while read old new branch
do
case "$new-$branch" in
000000000000000000*)
: echo "ignore deleted"
;;
*-refs/heads/live )
echo "UPDATING LIVE SITE";
git archive $new | (
@thirdknife
thirdknife / drupal-quick-dump.sh
Created November 16, 2012 15:17 — forked from timmillwood/drupal-quick-dump.sh
Script to dump Drupal database structure, but exclude data from massive/unneeded tables.
#!/bin/bash
# usage: drupal-quick-dump user host database
USER="$1"
HOST="$2"
DB="$3"
DATE=`date +%Y%m%d`
# Get User Password
echo "Please provide the password for ${USER} on db ${DB} hosted at ${HOST}:"
@thirdknife
thirdknife / gist:7448163
Created November 13, 2013 12:19
meteor template
<ul id="item-list">
{{#each itinerary}}
<li>{{_id}}</li>
{{/each}}
</ul>
@thirdknife
thirdknife / 0_reuse_code.js
Created November 28, 2013 17:52
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#!/bin/bash
# My first script
# make sure you always put $f in double quotes to avoid any nasty surprises i.e. "$f"
for f in ~/Desktop/dsg1_1000Genome/1000Genome_dsg1/1000Genome_dsg1/*
do
echo "Processing $f file..."
mv $f $f".vcf"
bgzip $f".vcf"
cat ~/Desktop/dsg1_1000Genome/arch_dsg1.fasta | perl vcf-consensus -s $f $f".vcf.gz" > $f".fa"
<?php
require_once(APPPATH.'/libraries/REST_Controller.php');
require_once(APPPATH . '/libraries/TSBAuth.php');
require_once(APPPATH . '/libraries/DeviceDetect.php');
class Messages extends REST_Controller {
var $requestUser = null;
public static $DEVICE ;
function __construct() {
parent::__construct();
/**
* INTERACTIVE CHROMOSOME VISUALIZATION
* opt : initialization options object
* + target: REQUIRED
* + segment: REQUIRED
*
*
*/
var d3 = require("d3");
[{"ChrLocation":"p","MemberName":"VAMP1"},{"ChrLocation":"p11.23","MemberName":"KCNJ8"},{"ChrLocation":"p13.31","MemberName":"ING4"},{"ChrLocation":"q","MemberName":"SLC38A2"},{"ChrLocation":"q","MemberName":"PLEKHA9"},{"ChrLocation":"q","MemberName":"CHST11"},{"ChrLocation":"q","MemberName":"SOCS2"},{"ChrLocation":"q11","MemberName":"ITGA5"},{"ChrLocation":"q12","MemberName":"ACCN2"},{"ChrLocation":"q12","MemberName":"RND1"},{"ChrLocation":"q12","MemberName":"PRKAG1"},{"ChrLocation":"q12","MemberName":"DHH"},{"ChrLocation":"q13","MemberName":"ITGA7"},{"ChrLocation":"q13","MemberName":"CDK2"},{"ChrLocation":"q13","MemberName":"PDE1B"},{"ChrLocation":"q13","MemberName":"SLC38A4"},{"ChrLocation":"q13","MemberName":"CACNB3"},{"ChrLocation":"q13","MemberName":"KCNH3"},{"ChrLocation":"q13","MemberName":"MYO1A"},{"ChrLocation":"q13","MemberName":"ZNFN1A4"},{"ChrLocation":"q13","MemberName":"NFE2"},{"ChrLocation":"q13","MemberName":"IGFBP6"},{"ChrLocation":"q13","MemberName":"ERBB3"},{"ChrLocation":"q13","MemberName