Skip to content

Instantly share code, notes, and snippets.

Avatar
🇺🇸

Blake Gideon ChicagoDev

🇺🇸
View GitHub Profile
View gmaps_places_local_barber_exception.py
import googlemaps
import json
from pprint import pprint
import time
## Import API Key
with open('config.json') as config_file:
config_data = json.load(config_file)
View for_loop.pl
#!/usr/bin/perl
use warnings;
use strict;
my @a = (1..9);
for(@a){
print("$_","\n");
}
View MTA_Constructor.py
def __init__(self, mta_week_numbers):
"""
MtaRidership class constructor
:param mta_week_numbers: A list of YYMMDD strings for the turnstile week files to load.
:return: MtaRidership
"""
self.turnstiles_df = []
self.turnstiles_daily = []
View mvp.py
def getMvp(self, N):
"""
Our Minimum Viable Product. Creates a bar graph with the top
N highest trafficked MTA stations.
:param N: Number of top stations (e.g. Top 10, Top 5) to use in the graph
:type N: int
:return: Seaborn figure to be shown with plt.show()
"""
View MTA_Constructor.py
def __init__(self, mta_week_numbers):
"""
MtaRidership class constructor
:param mta_week_numbers: A list of YYMMDD strings for the turnstile week files to load.
:return: MtaRidership
"""
self.turnstiles_df = []
self.turnstiles_daily = []
View cast_actor.py
from collections import namedtuple
CastMatch = namedtuple('CastMatch', 'role playedby cosine_dist')
def best_match(got_roles_list, clust_dict, vectorizer, topic_model, cluster_model):
matches = []
for person in got_roles_list:
View tom_hanks.json
{
"_id" : ObjectId("5c75b350fc0c4b23785abcce"),
"name" : "Tom Hanks",
"url" : "https://en.wikipedia.org/wiki/Tom_Hanks",
"wiki_doc" : "American actor and producer This article is about the American actor. For the seismologist, see Thomas C. Hanks. \n Tom HanksHanks in September 2016BornThomas Jeffrey Hanks (1956-07-09) July 9, 1956 (age 62)Concord, California, U.S.ResidenceLos Angeles, California, U.S.Alma materChabot CollegeCalifornia State University, Sacramento (BFA)OccupationActor, filmmakerYears active1977–presentWorksPerformancesNet worth$390 million (May 2014)[1]Political partyDemocraticSpouse(s)Samantha Lewes(m. 1978; div. 1987)Rita Wilson (m. 1988)Children4, including Colin HanksRelativesJim Hanks (brother)Larry Hanks (brother)AwardsFull list Thomas Jeffrey Hanks (born July 9, 1956) is an American actor and filmmaker. Hanks is known for his comedic and dramatic roles in such films as Splash (1984), Big (1988), Turner & Hooch (1989), A League of Their Own (1992), Sleepless in Seattle (
@ChicagoDev
ChicagoDev / avg.awk
Created Apr 11, 2018 — forked from jamerfort/avg.awk
Awk scripts for total/average/max/min. All numbers come in on STDIN
View avg.awk
#!/usr/bin/awk -f
BEGIN { TOTAL=0 }
{ TOTAL = TOTAL + $1 }
END { print TOTAL/NR }
View netstat_output.sh
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:15455 0.0.0.0:* LISTEN -
tcp6 0 0 :::22 :::* LISTEN 7/micro-inetd
@ChicagoDev
ChicagoDev / isConnected.java
Last active Aug 29, 2015
Checking for internet connectivity on Android
View isConnected.java
ConnectivityManager connMgr = (ConnectivityManager)
getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();
if (networkInfo != null && networkInfo.isConnected()) {
Log.d("MyActivity","Internet Connection Available");
} else {
Log.e("MyActivity","No internet connection");
}
//Source: http://developer.android.com/training/basics/network-ops/connecting.html