Skip to content

Instantly share code, notes, and snippets.

View gingi's full-sized avatar

Shiran Pasternak gingi

View GitHub Profile
==> Downloading http://www.graphviz.org/pub/graphviz/stable/SOURCES/graphviz-2.28.0.tar.gz
File already downloaded in /Users/pasternak/Library/Caches/Homebrew
/usr/bin/tar xf /Users/pasternak/Library/Caches/Homebrew/graphviz-2.28.0.tar.gz
==> Patching
/usr/bin/patch -f -p1 -i 001-homebrew.diff
patching file lib/gvc/Makefile.in
==> ./configure --disable-debug --disable-dependency-tracking --prefix=/usr/local/Cellar/graphviz/2.28.0 --with-qt=no --disable-quartz --disable-java --disable-ocaml --disable-perl --disable-php --disable-python --disable-r --disable-ruby --disable-sharp --disable-swig
./configure --disable-debug --disable-dependency-tracking --prefix=/usr/local/Cellar/graphviz/2.28.0 --with-qt=no --disable-quartz --disable-java --disable-ocaml --disable-perl --disable-php --disable-python --disable-r --disable-ruby --disable-sharp --disable-swig
checking build system type... x86_64-apple-darwin11.2.0
checking host system type... x86_64-apple-darwin11.2.0
@gingi
gingi / ensembl_id.sh
Created January 6, 2012 18:52
Fetch Ensembl gene IDs based on external ID.
#!/bin/sh
mysqluser='anonymous';
mysqlpass='';
mysqlhost='mysql.ebi.ac.uk';
mysqlport=4157;
function usage () {
[ -n "$1" ] && echo $1
cat <<USAGE
@gingi
gingi / smooth.pl
Created April 26, 2012 16:34
A script for smoothing BED files.
#!/usr/local/bin/perl
use strict;
use warnings;
use Readonly;
use List::MoreUtils qw/any/;
use Getopt::Long;
use Pod::Usage;
@gingi
gingi / Application.applicationWillSwitchOut.applescript
Created June 15, 2012 14:38 — forked from benspaulding/Application.applicationWillSwitchOut.applescript
AppleScript that will save all documents with unsaved changes when BBEdit loses focus.
(*
File:
Application.applicationWillSwitchOut.scpt
Abstract:
This script will automatically save all on-disk text documents with unsaved
changes when BBEdit loses focus.
Version:
@gingi
gingi / Text UnComment Selection.applescript
Created June 19, 2012 01:24
BBEdit Menu Script to Toggle Indented Comments
tell application "BBEdit"
tell front text window
set srcLang to source language of the selection
set commStr to ""
set closeStr to ""
if srcLang = "HTML" then
set commStr to "<!--"
@gingi
gingi / Join Line With Next.applescript
Created July 3, 2012 20:06
BBEdit Script: Join Line With Next
tell application "BBEdit"
tell window 1
set currentLine to endLine of selection
set nextLine to currentLine + 1
-- Delete starting after the last non-whitespace character in the current line
set findDeleteStart to find "\\s*$" options {search mode:grep} ¬
searching in line currentLine
if found of findDeleteStart then
set firstCharacter to characterOffset of found object of findDeleteStart
@gingi
gingi / Duplicate Lines.applescript
Created July 3, 2012 20:08
BBEdit Script: Duplicate Lines
tell application "BBEdit"
tell window 1
set start_line to startLine of selection
set end_line to endLine of selection
select (lines start_line thru end_line)
set selectionCopy to duplicate selection
select insertion point after selection
set selection to selectionCopy
end tell
end tell
@gingi
gingi / Crash log
Last active December 14, 2015 05:59
TextMate hangs with JavaScript bundle (v2.0-alpha.9387)
Date/Time: 2013-02-26 10:43:09 -0500
OS Version: 10.8.2 (Build 12C3006)
Architecture: x86_64
Report Version: 11
Command: TextMate
Path: /Applications/TextMate.app/Contents/MacOS/TextMate
Version: 2.0-alpha.9387 (9387)
Parent: launchd [145]
@gingi
gingi / app.js
Created April 1, 2013 20:18
CORS in an Express app.
app.use(function (req, res, next) {
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Credentials', true);
res.header('Access-Control-Allow-Methods',
'GET,PUT,POST,DELETE,OPTIONS,HEAD');
res.header('Access-Control-Allow-Headers', 'Content-Type');
next();
});
@gingi
gingi / gist:47df42a45bb1653002ee
Last active April 22, 2016 03:10
Redirecting HTTP requests to HTTPS in a Node.js Connect app.
function requireHTTPS(req, res, next) {
if (!req.secure) {
//FYI this should work for local development as well
var domain = "https://" + req.get("host");
if (process.env["SSL_PORT"]) {
domain = domain.replace(/:\d+$/, "");
domain += ":" + process.env["SSL_PORT"];
}
return res.redirect(domain + req.url);
}