Skip to content

Instantly share code, notes, and snippets.

@mathiasbynens
mathiasbynens / appify
Created November 12, 2010 13:46 — forked from subtleGradient/appify
appify — create the simplest possible Mac app from a shell script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
@jweir
jweir / protovis_to_link.js
Created November 19, 2010 19:23
How to save SVG data to a file from a web browser
@henrik
henrik / google_art_project.rb
Created February 5, 2011 23:22
I'M AFRAID THIS SCRIPT NO LONGER WORKS! MAYBE http://www.student.tugraz.at/kollmitzer/gap_howto.html OR https://github.com/EmelyanenkoK/GAPDownloader DOES. SEE COMMENTS. Google Art Project fullsize image downloader. Specify the page URL and the tiles are downloaded, stitched and trimmed.
# Google Art Project fullsize image downloader.
# By Henrik Nyh <http://henrik.nyh.se> 2011-02-05 under the MIT license.
# Requires Ruby and ImageMagick.
#
# NOTE:
# I'm afraid this script no longer works! See the Gist comments.
#
# Usage e.g.:
# ruby google_art_project.rb http://www.googleartproject.com/museums/tate/portrait-of-william-style-of-langley-174
#
@hrldcpr
hrldcpr / tree.md
Last active May 1, 2024 00:11
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@nickloman
nickloman / genbank_to_tbl.py
Created May 11, 2012 16:10
genbank_to_tbl.py
# requires biopython
# run like:
# genbank_to_tbl.py "my organism name" "my strain ID" "ncbi project id" < my_sequence.gbk
# writes seq.fsa, seq.tbl as output
import sys
from copy import copy
from Bio import SeqIO
def find_gene_entry(features, locus_tag):
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 5, 2024 17:27
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@vrypan
vrypan / dyndns53.py
Last active August 12, 2021 21:43
Python script to add/update an A record at amazon area53 DNS service, using current IP. (ie, dyndns replacement)
from area53 import route53
from boto.route53.exception import DNSServerError
import requests
import sys
from datetime import datetime
# Modified from https://markcaudill.me/blog/2012/07/dynamic-route53-dns-updating-with-python/
domain = 'domain.tld'
subdomain = 'subdomain_name'
@stamat
stamat / importFromUri.py
Last active November 15, 2017 12:32
Dynamically imports python modules by given module URI
import os
import imp
def importFromURI(self, uri, absl=False):
if not absl:
uri = os.path.normpath(os.path.join(os.path.dirname(__file__), uri))
path, fname = os.path.split(uri)
mname, ext = os.path.splitext(fname)
no_ext = os.path.join(path, mname)
@amoslanka
amoslanka / rsyslog.conf
Last active July 8, 2021 07:47
Configuration for rsyslog for Nginx and PHP only. Output to /var/log/loggly and send to Loggly as well.
#################
#### MODULES ####
#################
$ModLoad imuxsock # provides support for local system logging
$ModLoad imfile
###########################
#### GLOBAL DIRECTIVES ####
###########################
@plentz
plentz / nginx.conf
Last active June 3, 2024 13:58
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048