This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In order to use this script, you must replace 'YOURUSERNAMEHERE' with your Spotify username. | |
# Execute this script like so: 'osascript alarm_clock_spotify.scpt' (without single-quotes obviously) | |
# Full explanation here: http://www.nikhilgopal.com/2011/08/show-and-tell-applescript-spotify-alarm.html | |
# If you would like to specify a playlist, please refer to this gist: https://gist.github.com/3344118 | |
set volume 2 | |
open location "spotify:user:YOURUSERNAMEHERE:playlist:muzic" | |
tell application "Spotify" | |
set the sound volume to 0 | |
play |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In order to use this script, you must replace 'YOURUSERNAMEHERE' with your Spotify username. | |
# Execute this script like so: 'osascript start_spotify_with_playlist.scpt' (without single-quotes) | |
# Full explanation here: http://www.nikhilgopal.com/2011/08/show-and-tell-applescript-spotify-alarm.htm | |
delay 2 | |
open location "spotify:user:YOURUSERNAMEHERE:playlist:muzic" | |
tell application "Spotify" | |
play | |
end tell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlite3 | |
file = open('quotes_file.txt', 'r') | |
line = '' | |
quotes = [] | |
for i in file.readlines(): | |
if i == '\r\n': | |
print "BLANK", i | |
quotes.append(line) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, url_for, render_template, g, redirect | |
import random | |
import sqlite3 | |
DATABASE = 'quotes.db' | |
app = Flask(__name__) | |
def connect_db(): | |
return sqlite3.connect(DATABASE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"net/http" | |
) | |
func handler(w http.ResponseWriter, r *http.Request) { | |
fmt.Fprintf(w, "Why in the world are you looking for %s on your localhost? lolz.", r.URL.Path[1:]) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
START source=node(10), destination=node(144) | |
MATCH p = allShortestPaths(source-[r:interacts*..3]->destination) | |
RETURN NODES(p); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This program takes the PPI data from ConsensusDB and populates the NEO4J database with it | |
# By Nikhil Gopal | |
# | |
# To run: python populate_running_db.py ConsensusDB_Human_PPI nodes_list.txt | |
# The code to generate the nodes_list.txt file exists here: https://gist.github.com/ngopal/9164294 | |
import os, sys | |
from neo4jrestclient.client import GraphDatabase | |
from itertools import chain, combinations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew install neo4j |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To start server | |
neo4j start | |
# To stop server | |
neo4j stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, sys | |
from itertools import chain, combinations | |
genes_set = set([]) | |
for i in open(sys.argv[1], 'r').readlines(): | |
if '#' in i: | |
continue | |
else: | |
line = i.strip('\r\n').split('\t') | |
genes = line[2].replace('_HUMAN','').split(',') |
OlderNewer