Skip to content

Instantly share code, notes, and snippets.

View selahlynch's full-sized avatar

Selah Lynch selahlynch

View GitHub Profile

Keybase proof

I hereby claim:

  • I am selahlynch on github.
  • I am selahlynch (https://keybase.io/selahlynch) on keybase.
  • I have a public key ASAAuukYX1TEcUA0YssiuPnAEN7uYkGvougAksT7JIkyfAo

To claim this, I am signing this object:

@selahlynch
selahlynch / climate_data.py
Created January 24, 2017 21:33
Generate climate data graph
%matplotlib qt
import pandas as pd
df = pd.read_csv("/home/selah/Data/PHL climate data.csv")
#df.plot(use_index=True,y='TMAX',grid=True)
import matplotlib.pyplot as plt
import datetime as dt
import sys
import sqlalchemy
from PERMA.code.mysql_scripts import mysql_iter_funcs
from osgeo import ogr
if len(sys.argv) == 6:
(schema, table, out_column, shapefile, shape_field) = sys.argv[1:]
else:
print "Usages map_coordinates.py <schema> <table> <out_column> <shapefile> <shape_field>"
import MySQLdb
import time
import sys
import logging
class MySQLdbSession:
def __init__(self, mysqldb_connect_params, max_reconnect_attempts=5, pause_between_attempts=1, is_ss=False):
self.mysqldb_connect_params = mysqldb_connect_params
self.reconnect_attempts = 0
@selahlynch
selahlynch / TwitterMySQL.py
Last active August 29, 2015 14:13
social media posts gathering
#! /usr/bin/python
__author__ = "Maarten Sap"
__email__ = "maartensap93@gmail.com"
__version__ = "0.3"
"""
TODOs:
pull retweeted message as well as original
@selahlynch
selahlynch / groupData-service-e2e.js
Created August 21, 2014 21:18
MacroSim - code for presentation
'use strict';
//make assumption that players S1-S6 exist
describe('Macrosim Homepage', function() {
beforeEach(function(){
//login to macrosim
browser.get('http://localhost:4444/simulate/lldev/macrosim/simulation/#/login');
@selahlynch
selahlynch / gist:7536502
Created November 18, 2013 22:27
timer code
Timer.prototype.start = function() {
var self = this;
(function countdown() {
if (self.count > 0) {
var m = Math.floor(self.count / 60);
var s = self.count % 60;
self.onTick(formatTime(m),formatTime(s));
self.count = self.count - 1;
$timeout(countdown, 1000);
}
@selahlynch
selahlynch / gist:7536483
Created November 18, 2013 22:25
instructor gameManagment view
<w-accordion>
<w-accordion-group ng-repeat="(founder, founderData) in founders" is-open="$first">
<w-accordion-heading>
<div class="pull-right">
<span class="label label-success">{{founderData.counts.investment}} Investor(s)</span>
<span class="label label-success">{{founderData.counts.hire}} Employee(s)</span>
</div>
<img ng-src="{{founderData.roleDesc.avatar}}"> {{founder}}
</w-accordion-heading>
@selahlynch
selahlynch / gist:7536472
Created November 18, 2013 22:25
immediate function example
var days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
today = new Date(),
msg = 'Today is ' + days[today.getDay()] + ', ' + today.getDate();
alert(msg);
//////////////////////////////////////////////////////////////////
(function () {
@selahlynch
selahlynch / gist:7536450
Created November 18, 2013 22:23
gameBoard controller definition
'use strict';
angular.module('simulateApp')
.controller('InstructorGameBoardCtrl', ['$scope', '$rootScope', 'NEWS', '$timeout', 'GameCharacter', 'Chat', 'gameBoardData', 'Data', 'players', '$location', 'DecisionsDataAnalyzer', 'Timer', 'GameStateManagement', '$route', function ($scope, $rootScope, NEWS, $timeout, GameCharacter, Chat, gameBoardData, Data, players, $location, DecisionsDataAnalyzer, Timer, GameStateManagement, $route) {
$rootScope._pageTitle = 'Gameboard';
var newsToMerge;
var newestFirst = function (a, b) {
return b.date - a.date;