Skip to content

Instantly share code, notes, and snippets.

View thejeshgn's full-sized avatar

Thejesh GN thejeshgn

View GitHub Profile
@lxbarth
lxbarth / index.html
Created August 7, 2013 21:06
via:geojson.io
<!DOCTYPE html>
<html>
<head>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
.marker-properties {
border-collapse:collapse;
@rduplain
rduplain / Makefile
Created April 27, 2013 02:06
Makefile for key interactions on a Flask project deployed on heroku.
# Key project interactions, but not all dependencies are resolved by make.
help:
@heroku help
run:
python manage.py runserver
shell:
python manage.py shell
@funkenstrahlen
funkenstrahlen / sshuttle helpers
Created January 26, 2013 10:21
some aliases for sshuttle
# sshuttle helpers
#
# To load, you can add a line in ~/.bashrc:
# source ~/.bashrc.d/sshuttle_helpers
#
# or add a few lines to load all files in ~/.bashrc.d
# for f in ~/.bashrc.d/*; do
# source $f;
# done
#
@coderofsalvation
coderofsalvation / RESTdoc
Last active June 7, 2022 01:43
Quickndirty bash-utility to generate REST-documentation from sourcecode comments into css-styles html (or plainhtml). Can be handy for inclusion into phpdoc/phpdoctor/doxygen-dochains, instead of using heavyweight alternatives.
#!/bin/bash
#
# A quickndirty bash-utility to generate REST-documentation from sourcecode comments.
# (initially aimed at php-files, but js should also work)
# Basically its a c-style comment -> markdown -> html converter
# Dependancies:
# - awk
# - sed
# - bash
# - php
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@tollmanz
tollmanz / gist.css
Created June 3, 2012 19:16
Add Cacheable Gists to Your WordPress Site
.gist {
color: #e4322e;
}
.gistdiv {
padding: 0;
margin: 0;
}
.gist .gist-file {

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@erans
erans / get_lat_lon_exif_pil.py
Created May 20, 2011 21:16
Get Latitude and Longitude from EXIF using PIL
from PIL import Image
from PIL.ExifTags import TAGS, GPSTAGS
def get_exif_data(image):
"""Returns a dictionary from the exif data of an PIL Image item. Also converts the GPS Tags"""
exif_data = {}
info = image._getexif()
if info:
for tag, value in info.items():
decoded = TAGS.get(tag, tag)
@amix
amix / amazon_sender.py
Created May 17, 2011 13:39
Amazon SES helper script using boto
# -*- coding: utf-8 -*-
"""
amazon_sender.py
~~~~~~~~
Python helper class that can send emails using Amazon SES and boto.
The biggest feature of this class is that encodings are handled properly.
It can send both text and html emails.
This implementation is using Python's standard library (which opens up for a lot more options).
// force certain pages to be refreshed every time. mark such pages with
// 'data-cache="never"'
//
jQuery('div').live('pagehide', function(event, ui){
var page = jQuery(event.target);
if(page.attr('data-cache') == 'never'){
page.remove();
};
});