Skip to content

Instantly share code, notes, and snippets.

View tlnagy's full-sized avatar

Tamas Nagy tlnagy

View GitHub Profile
@tlnagy
tlnagy / gnu_osx_install
Last active October 17, 2018 15:14
This small script uses Homebrew to make your OS X machine more Linux-like by adding the GNU variants of many command line tools to your PATH. You will need Xcode's command line tools and homebrew installed. Also you'll need to quit and re-initialize your shell to see the changes.
#! /bin/sh
# Copyright (c) 2014, Tamas Nagy <tamas at tamasnagy dot com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
@tlnagy
tlnagy / gist:095333ed775716a19922
Created March 21, 2015 16:01
Pretty, automatic, git-based change logs (a la syncthing)
#!/bin/bash
since="$1"
if [[ -z $since ]] ; then
since="$(git describe --abbrev=0 HEAD^).."
fi
git log --pretty=format:'* %s (%h, @%aN)' "$since" | egrep 'fixes #\d|ref #\d'
@tlnagy
tlnagy / rama.py
Last active August 31, 2015 18:53
ipqb bootcamp programming assignment
from __future__ import division, print_function
import sys
if sys.version_info[0] < 3:
print("Python 3 required")
sys.exit(1)
import math, urllib.request, re
try:
import matplotlib.pyplot as plt
import seaborn as sns
except ImportError:
@tlnagy
tlnagy / script.py
Created September 22, 2015 23:30
pubs_plotting_code
import pickle
import seaborn as sns
sns.set_style("whitegrid")
%pylab --no-import-all
%matplotlib inline
flatui = ["#9b59b6", "#3498db", "#95a5a6", "#e74c3c", "#34495e", "#2ecc71"]
data = pickle.load(open("allele_dic.pkl", "rb"))
translate = pickle.load(open("translate.pkl", "rb"))
aminotonumber = pickle.load(open("aminotonumber.pkl", "rb"))
@tlnagy
tlnagy / type_example.jl
Last active March 15, 2016 20:45
Example of default constructor in julia
# type definition
type NewType
b::AbstractMatrix
end
# default constructor
# initializes a new `NewType` with a random
# 5x5 matrix stored in b
NewType() = NewType(rand(5,5))
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tlnagy
tlnagy / multibin_crispulator.ipynb
Created February 9, 2018 22:29
Example of new multi-bin support in Crispulator
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Keybase proof

I hereby claim:

  • I am tlnagy on github.
  • I am tlngy (https://keybase.io/tlngy) on keybase.
  • I have a public key ASCZ0v6_xUtiDFmiRIqOknf6Zmu36GVYNVECLzJHKjTjbAo

To claim this, I am signing this object:

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tlnagy
tlnagy / MuniScraper.jl
Last active January 7, 2020 02:22
A scraper for SF Muni train data (only tested on OpenSUSE Leap 15.1, Julia 1.1.1)
"""
Copyright (c) 2019 Tamas Nagy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: