Skip to content

Instantly share code, notes, and snippets.


Sam Boysel sboysel

View GitHub Profile
gbaman /
Created Nov 1, 2017
An example on using the Github GraphQL API with Python 3
# An example to get the remaining rate limit using the Github GraphQL API.
import requests
headers = {"Authorization": "Bearer YOUR API KEY"}
def run_query(query): # A simple function to use to make the API call. Note the json= section.
request ='', json={'query': query}, headers=headers)
if request.status_code == 200:
etcwilde / ght-restore-psql
Last active Sep 3, 2019
Restore the GHTorrent database to postgres instead of mysql (based on mysql-2017-01-19 image)
View ght-restore-psql
#!/usr/bin/env bash
# Evan Wilde <>
# July 20, 2017
# defaults
guyzmo /
Created May 28, 2017
Connect to Wifi networks using network manager listed by fzf
local ssid
local conn
nmcli device wifi rescan > /dev/null
ssid=$(nmcli device wifi list | tail -n +2 | grep -v '^ *\B--\B' | fzf -m | sed 's/^ *\*//' | awk '{print $1}')
if [ "x$ssid" != "x" ]; then
# check if the SSID has already a connection setup
conn=$(nmcli con | grep "$ssid" | awk '{print $1}' | uniq)
DaniSancas /
Created Jun 14, 2016
Neo4j's Cypher queries cheatsheet

Neo4j Tutorial


Store any kind of data using the following graph concepts:

  • Node: Graph data records
  • Relationship: Connect nodes (has direction and a type)
  • Property: Stores data in key-value pair in nodes and relationships
  • Label: Groups nodes and relationships (optional)
jexp /
Last active May 10, 2021
Panama Papers Import Scripts for Neo4j
export NEO4J_HOME=${NEO4J_HOME-~/Downloads/neo4j-community-3.0.1}
if [ ! -f ]; then
curl -OL
export DATA=${PWD}/import
rm -rf $DATA
dholstius / rgdal-install-with_homebrew.R
Last active Apr 13, 2018
rgdal installation on OS X
View rgdal-install-with_homebrew.R
install_from_source <- function (pkg, args = NULL, repos = "", overwrite = FALSE, ...) {
if (!overwrite) {
if (pkg %in% installed.packages()) {
message(pkg, " is already installed")
dannguyen /
Last active May 8, 2020
Using bash, csvkit, and SQLite to analyze San Francisco restaurant health inspection data

How to download, import, and analyze San Francisco restaurant inspection data using SQLite3 and csvkit from the command-line.

A quick example of doing data wrangling from the command-line, as well as getting to know one of San Francisco's data sets: the San Francisco restaurant inspections, courtesy of the SF Department of Public Health. I don't normally do database work from the command-line, but importing bulk data into SQLite is pretty frustrating using the available GUIs or just the shell.

So thank goodness for Christopher Groskopf's csvkit, a suite of Unix-like tools that use Python to robustly handle CSV files. There's a lot of great tools in csvkit, but for this gist, I just use csvsql, which can parse a CSV and turn it into properly-flavored SQL to pass directly into your database app of choice.


npm rank

This gist is updated daily via cron job and lists stats for npm packages:

  1. Top 1,000 most depended-upon packages
  2. Top 1,000 packages with largest number of dependencies
  3. Top 1,000 packages with highest PageRank score
cheerfulstoic / gist:7e8ec61f9104017430af
Last active Apr 12, 2022
Examining what is possible for StackOverflow with a graph database
View gist:7e8ec61f9104017430af

Analyzing StackOverflow with Neo4j and Clojure

Joining multiple disparate data-sources, commonly dubbed Master-Data-Management (MDM), is usually not a fun exercise. I would like to show you how using a graph database (Neo4j) and an interesting dataset (developer-oriented collaboration sites) to put the fun back into MDM. This approach will allow you to quickly and sensibly merge data from different sources into a consistent picture and query across the data efficiently to answer your most pressing questions.

You can read the associated blog posts on my blog. The blog posts cover the hows and whys of the project, while this and other GraphGists will examine how to answer specific questions of the data.

jennybc /
Last active Sep 23, 2022
Stop the working directory insanity

There are packages for this now!

2017-08-03: Since I wrote this in 2014, the universe, specifically Kirill Müller (, has provided better solutions to this problem. I now recommend that you use one of these two packages:

  • rprojroot: This is the main package with functions to help you express paths in a way that will "just work" when developing interactively in an RStudio Project and when you render your file.
  • here: A lightweight wrapper around rprojroot that anticipates the most likely scenario: you want to write paths relative to the top-level directory, defined as an RStudio project or Git repo. TRY THIS FIRST.

I love these packages so much I wrote an ode to here.

I use these packages now instead of what I describe below. I'll leave this gist up for historical interest. 😆