Skip to content

Instantly share code, notes, and snippets.

View mndoci's full-sized avatar

Deepak Singh mndoci

View GitHub Profile
@mndoci
mndoci / gist:9314
Created September 7, 2008 20:49 — forked from entryway/gist:9313
undefined
require 'rubygems'
require_gem 'activerecord'
require '/var/www/hoosier/app/models/payment_method'
#Connect to the database
ActiveRecord::Base.establish_connection(
:adapter => "postgresql",
:host => "localhost",
:username => "****",
:password => "****",
@mndoci
mndoci / gist:9315
Created September 7, 2008 20:51 — forked from mza/gist:8787
Task: Protein lookup
Find protein structure for 1MBN
From PDB
Return sequence of protein
Task: Blast
Run BLAST
Using the protein sequence from Protein lookup task
On uniprot
Select all hits with e < 0.00001
# This is a simple command line tool for uploading
# and folders of files to AWS S3. You must first
# create a vaild bucket to upload to.
#!/usr/bin/env ruby
require 'rubygems'
require 'pathname'
require 'aws/s3'
include AWS::S3
#!/usr/bin/ruby
# save as pubmed.rb and test using 'ruby pubmed.rb 19662644'
# keyword search may return > 1 record due to retmax bug
# http://github.com/bioruby/bioruby/commit/51c3223e033b2992a7bd95da282f88164406ff92
# From Neil Saunders http://gist.github.com/164994
require 'rubygems'
require 'bio'
keywords = ARGV.join(' ')
# If you use osx terminal/git this includes a couple nice features:
# 1) Minimalist colors
# 2) Stripped down CLEAN prompt
# 3) For GIT folders it will display the current branch.
# To install just copy this into the top of your ~/.bash_profile
# Based on http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/[\1]/'
}
#SWITCHES
#-d (cap deploy when check-in finished)
#-v (verbose, defaults to quiet)
#-m "commit message" (custom commit message)
#!/bin/bash
## options to be accepted
optstr=m:dv ## colon follows options that require an argument
while getopts $optstr var
do
=== Epic Snow Leopard Upgrayyyyd Guide ===
Son, you’re now living in the land of 64-bit systems.
That means that some of your 32-bit shit is now broken.
Not all is lost.
== Fixing MySQL weirdness
@mndoci
mndoci / clj.sh
Created September 13, 2009 16:31
#!/bin/sh
# -*- sh -*-
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home
export PATH=$JAVA_HOME/bin:$PATH
CLJ=$HOME/Projects/clj/clojure
java \
-server \
(ns examples.fs
(:import
(org.apache.log4j Level Logger)
(java.io BufferedReader InputStream InputStreamReader))
(:use [clojure.contrib.test-is :only (deftest is)])
(:use [clojure.contrib.except :only (throwf throw-arg)])
(:require [clojure.contrib.duck-streams :as ds]
[examples.imports :as import]))
(ns examples.fs
(:import
(org.apache.log4j Level Logger)
(java.io BufferedReader InputStream InputStreamReader))
(:use [clojure.contrib.test-is :only (deftest is)])
(:use [clojure.contrib.except :only (throwf throw-arg)])
(:require [clojure.contrib.duck-streams :as ds]
[examples.imports :as import]))