Skip to content

Instantly share code, notes, and snippets.

Mike Tigas mtigas

Block or report user

Report or block mtigas

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
View gini-1.py
from __future__ import division
def gini(population):
"""
https://en.wikipedia.org/wiki/Gini_coefficient#Calculation
see "This may be simplified to:"
"""
pop = sorted(population)
n = len(pop)
View 0.txt
-Step 1: basic HTML skeleton for a full-screen map
-Step 2: initialize a map
-Step 3: add a tile layer
-Step 4: Add a marker
-Step 5: Add a line
-Step 6: Add a polygon
-Step 7: Styling: add a polygon with different styling
-Step 8: Click/hover
-On click, re-center map
-On hover, change styling of polygon
@mtigas
mtigas / twitter_ebook.py
Last active Dec 11, 2015 — forked from argv0/gist:3627514
oh god what have i done
View twitter_ebook.py
"""
usage: twitter_ebook.py [-h] [--num NUM] archive_dir
Generate some tweets based on the CSV in a Twitter archive download
positional arguments:
archive_dir path your unzipped Twitter archive
optional arguments:
-h, --help show this help message and exit
@mtigas
mtigas / gist:1304751
Created Oct 21, 2011 — forked from ryanpitts/gist:1304725
GROUP BY and Select MAX from each group in Django, 2 queries
View gist:1304751
'''
given a Model with:
category = models.CharField(max_length=32, choices=CATEGORY_CHOICES)
pubdate = models.DateTimeField(default=datetime.now)
<other fields>
Fetch the item from each category with the latest pubdate.
'''
@mtigas
mtigas / install_homebrew.rb
Created Jul 15, 2011 — forked from mxcl/install_homebrew.markdown
Installs Homebrew to /usr/local so you don't need sudo to `brew install`
View install_homebrew.rb
#!/usr/bin/ruby
#
# This script installs to /usr/local only. To install elsewhere you can just
# untar https://github.com/mxcl/homebrew/tarball/master anywhere you like.
#
#
# 30th March 2010:
# Added a check to make sure user is in the staff group. This was a problem
# for me, and I think it was due to me migrating my account over several
# versions of OS X. I cannot verify that for sure, and it was tested on
@mtigas
mtigas / gist:1007030
Created Jun 3, 2011 — forked from n0nick/gist:1006549
wget-1.12-subjectAltNames.diff
View gist:1007030
diff --git a/src/openssl.c b/src/openssl.c
index b55ca8b..b036a3b 100644
--- a/src/openssl.c
+++ b/src/openssl.c
@@ -39,7 +39,7 @@ as that of the covered work. */
#include <string.h>
#include <openssl/ssl.h>
-#include <openssl/x509.h>
+#include <openssl/x509v3.h>
View import_usat.sh
#!/bin/bash
#
# usat_import
# Fork by Mike Tigas
# Based on work by Ryan Nagle, Chris Groskopf and Brian Boyer
#
# Updated to allow import of multiple states into the same database.
# Unlike the original script, this *only* generates super-wide tables.
#
# Shapes are stored in WGS84 (EPSG:4326) for portability.
View logging.py
from reviewgallery.settings.development.defaults import *
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'default': {
'format': '%(name)s-%(levelname)s -- %(message)s'
}
},
View gist:219443
# .zshrc
alias lstree="ls -R | grep \":$\" | sed -e 's/:$//' -e 's/[^-][^\/]*\//–/g' -e 's/^/ /' -e 's/-/|/'"
autoload colors zsh/terminfo
if [[ "$terminfo[colors]" -ge 8 ]]; then
colors
fi
for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do
eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}'
You can’t perform that action at this time.