Skip to content

Instantly share code, notes, and snippets.

View SeanPlusPlus's full-sized avatar

Sean Stephenson SeanPlusPlus

View GitHub Profile
A T
B C
C E
D X
B C
A T
B C
$('ul.nav').children('li').removeClass('active');
var mosquitoLocation = window.location.href.split("/")[3];
var mosquitoTarget = mosquitoLocation.charAt(0).toUpperCase() + mosquitoLocation.slice(1);
$("a:contains('" + mosquitoTarget + "')").parent().addClass('active');
<script type="text/javascript">
$('ul.nav').children('li').removeClass('active');
var mosquitoLocation = window.location.href.split("/")[3];
var mosquitoTarget = mosquitoLocation.charAt(0).toUpperCase() + mosquitoLocation.slice(1);
$("a:contains('" + mosquitoTarget + "')").parent().addClass('active');
</script>
$( document ).ready( function(){
$.getJSON( '/js/main.json', function( data ) {
function showNav() {
var nav = [];
$.each( data, function( key, val ) {
nav.push( '<li><a href=#' + key + '>' + key + '</a></li>' );
});
$( '.nav' ).html( nav.join( ' ' ) );
}
@SeanPlusPlus
SeanPlusPlus / days-til-thrones.py
Created August 31, 2012 07:40
days til game of thrones season 3
#!/usr/bin/env python
import sys
sys.path.append("./my_new_env/lib/python2.6/site-packages")
import requests
import re
print "Content-type: text/html\n"
r = requests.get('http://daycalc.appspot.com/03/31/2013')
m = re.search('<span class=\"du\">(.+?)days', r.text)
if m:
found = m.group(1)
git log --graph --all --pretty=format:'%C(yellow)%h%C(cyan)%d%Creset %s %C(white)- %an, %ar%Creset'
@SeanPlusPlus
SeanPlusPlus / dict_to_csv_in_flask.py
Last active November 12, 2020 21:18
dictionary to csv with python / flask
# this is my list of dictionaries
my_list_of_dicts = get_array_of_dictionaries()
# add dict as first element to be header
header = {}
for k,v in my_list_of_dicts[0].items():
header[k] = k
my_list_of_dicts.insert(0,header)
# iterate through my_list_of_dicts
@SeanPlusPlus
SeanPlusPlus / script.py
Created October 17, 2013 17:37
script.py
#!/usr/bin/env python
import os
old_file = open(os.path.join(os.path.realpath(os.path.join(os.getcwd(),
os.path.dirname(__file__))), 'old_file.txt'));
new_file = open(os.path.join(os.path.realpath(os.path.join(os.getcwd(),
os.path.dirname(__file__))), 'new_file.txt'), 'w');
@SeanPlusPlus
SeanPlusPlus / Deserted Island Tool Box
Last active January 4, 2016 06:59
Deserted Island Tool Box
Attempting to define my necessary digital tool set if on a deserted island.
List goes from lower to higher level tools.
Linux
Vim
Vim Nerdtree
Git
Mutt
Weechat
@SeanPlusPlus
SeanPlusPlus / Agility
Last active August 29, 2015 13:57
Agility
From: http://pragdave.me/blog/2014/03/04/time-to-kill-agile/
Individuals and Interactions - over - Processes and Tools
Working Software - over - Comprehensive Documentation
Customer Collaboration - over - Contract Negotiation, and
Responding to Change - over - Following a Plan
What to do:
Find out where you are