Skip to content

Instantly share code, notes, and snippets.

💭
Adjunct Professor for "Computer Science I"

Greg Hilston GregHilston

💭
Adjunct Professor for "Computer Science I"
Block or report user

Report or block GregHilston

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@GregHilston
GregHilston / wpa_supplicant.conf
Last active Apr 21, 2019
Add an empty file called "ssh" and this file to the root of your Raspberry Pi SD card to automate the connection to wifi
View wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US
network={
ssid=""
psk=""
key_mgmt=WPA2-PSK
}
@GregHilston
GregHilston / file_cleaner.py
Last active Jul 12, 2018
Deletes all files that are missing a given string in their name
View file_cleaner.py
# Hey everyone, I was having a tough time cleaning up my ROMs, as there would be multiple versions of the same game, like:
# Super-Smash(Japan).rom
# Super-Smash(Europe).rom
# Super-Smash(USA).rom
# I ended up writing this small Python (3.6) script that you can use to cleanup duplicate files.
# Execution looks like this, if you want to keep only USA files:
@GregHilston
GregHilston / test.ipynb
Created May 2, 2018
Testing hour gists handle ipynb files
View test.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@GregHilston
GregHilston / visualizing-geospatial-data-read.py
Created Apr 25, 2018
First we'll create a `Pandas.DataFrame` out of a `json` file hosted by NASA.
View visualizing-geospatial-data-read.py
# Data from NASA on meteorite landings
df = pd.read_json(data_directory + "y77d-th95.json")
@GregHilston
GregHilston / visualizing-geospatial-data-setup.py
Created Apr 25, 2018
Prepares our notebook, defining our imports and global variables
View visualizing-geospatial-data-setup.py
# ensure our graphs are displayed inline
%matplotlib inline
import os
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sb
import numpy as np
import folium
from folium import plugins
@GregHilston
GregHilston / gist-to-png.js
Last active Apr 18, 2018 — forked from fgeorges/blog--gist-to-png-01.js
This Gist assists you in creating a screen shot of a Gist. I use it to post screen shots on LinkedIn.
View gist-to-png.js
#!/usr/local/bin/phantomjs
var page = require('webpage').create();
var system = require('system');
// ***** Argument handling
function isInt(value) {
return !isNaN(value) &&
parseInt(Number(value)) == value &&
View automating_the_boring_stuff_renaming_files.py
# contains helpful premade actions we'll be using later.
# Anything that starts with os. came from this
import os
# gets a list of all the items in the current directory
file_names = os.listdir(".")
# we'll loop over every file in the current directory
for file_name in file_names:
# define the prefix we're looking to remove
@GregHilston
GregHilston / eprint.py
Created Dec 18, 2017
Prints a message to stderr
View eprint.py
import sys
def eprint(*args, **kwargs):
"""Prints a message to stderr
:param args: variable amount of arg Strings to print to stderr
:param kwargs: variable amount of keyword arg Strings to print to stderr
"""
View keybase.md

Keybase proof

I hereby claim:

  • I am greghilston on github.
  • I am grehg (https://keybase.io/grehg) on keybase.
  • I have a public key ASCOOcDrU1i_l9t_2Fe5SKfOOUKZ_hY3R32NJLxENliGXgo

To claim this, I am signing this object:

View miss_grehg.py
#!/usr/bin/python3
response = ""
affirmative = "y"
negative = "n"
while(response != affirmative and response != negative):
response = input("Do you miss Grehg? [{}/{}]".format(affirmative, negative))
You can’t perform that action at this time.