Skip to content

Instantly share code, notes, and snippets.

View sboysel's full-sized avatar

Sam Boysel sboysel

View GitHub Profile
@sboysel
sboysel / query.sql
Created February 1, 2019 20:15
Most popular Stack Overflow tags (Stack Exchange Data Explorer query)
select
num.TagName as Tag,
row_number() over (order by num.Num desc) as TotalRank,
rate.Rate as QuestionsInMay,
num.Num as QuestionsTotal
from
(select count(PostId) as Rate, TagName
from
@sboysel
sboysel / ght-restore-psql
Created February 13, 2019 03:18 — forked from etcwilde/ght-restore-psql
Restore the GHTorrent database to postgres instead of mysql (based on mysql-2017-01-19 image)
#!/usr/bin/env bash
# Evan Wilde <[email protected]>
# July 20, 2017
# defaults
user="postgres"
passwd=""
host="localhost"
db="ghtorrent"
tmpdir='/tmp'
@sboysel
sboysel / keybase.md
Created December 2, 2019 06:39
keybase.io proof of GitHub identity

Keybase proof

I hereby claim:

  • I am sboysel on github.
  • I am sboysel (https://keybase.io/sboysel) on keybase.
  • I have a public key whose fingerprint is F0BB B0B8 886D 1CDB 392D E755 2E8D EF7C 3554 032D

To claim this, I am signing this object:

[
{
"name": "Risha38",
"author": "Sam Boysel"
},
[
{
"x": 2,
"f": 5
},
@sboysel
sboysel / timer.py
Created May 21, 2024 16:41
simple timer function decorator
import time
def timer(f):
"""
timer function decorator. Prints time elapsed (in seconds) of the function's
runttime.
Usage:
@timer
@sboysel
sboysel / root.py
Created May 21, 2024 16:44
package root variable
"""
simple way to get the directory path of the current file.
Extension: simply add additonal `.parent`s if __file__ is in a subdirectory of ROOT
"""
import pathlib
ROOT = pathlib.Path(__file__).parent