Skip to content

Instantly share code, notes, and snippets.

Skylar Saveland skyl

View GitHub Profile
crgimenes / stringToReaderCloser.go
Last active May 24, 2020
string to io.ReadCloser
View stringToReaderCloser.go
package main
import (
func main() {
r := ioutil.NopCloser(bytes.NewReader([]byte("hello world"))) // r type is io.ReadCloser
jashkenas /
Last active Jul 19, 2020
Why Semantic Versioning Isn't

Spurred by recent events (, this is a quick set of jotted-down thoughts about the state of "Semantic" Versioning, and why we should be fighting the good fight against it.

For a long time in the history of software, version numbers indicated the relative progress and change in a given piece of software. A major release (1.x.x) was major, a minor release (x.1.x) was minor, and a patch release was just a small patch. You could evaluate a given piece of software by name + version, and get a feeling for how far away version 2.0.1 was from version 2.8.0.

But Semantic Versioning (henceforth, SemVer), as specified at, changes this to prioritize a mechanistic understanding of a codebase over a human one. Any "breaking" change to the software must be accompanied with a new major version number. It's alright for robots, but bad for us.

SemVer tries to compress a huge amount of information — the nature of the change, the percentage of users that wil

pydanny / wtf
Created Jul 31, 2013
South 0.8.1, Django 1.6b2, Python 3.3.2. Occurs in PostgreSQL and SQLite3
View wtf
Running migrations for socialaccount:
- Migrating forwards to 0011_auto__chg_field_socialtoken_token.
> socialaccount:0001_initial
Traceback (most recent call last):
File "", line 10, in <module>
File "/Users/danielgreenfeld/.envs/cheesely_project/lib/python3.3/site-packages/django/core/management/", line 397, in execute_from_command_line
File "/Users/danielgreenfeld/.envs/cheesely_project/lib/python3.3/site-packages/django/core/management/", line 390, in execute
iamatypeofwalrus /
Last active Mar 9, 2020
Create an iPython HTML Notebook on Amazon's AWS Free Tier from scratch.


Roll your own iPython Notebook server with Amazon Web Services (EC2) using their Free Tier.

What are we using? What do you need?

  • An active AWS account. First time sign-ups are eligible for the free tier for a year
  • One Micro Tier EC2 Instance
  • With AWS we will use the stock Ubuntu Server AMI and customize it.
  • Anaconda for Python.
  • Coffee/Beer/Time
kayzhu / csrf.js
Last active Sep 27, 2016
Send POST request in Angular.js to a CSRF-protected Django view
View csrf.js
<script type="text/javascript" src="/angular/angular.js"></script>
<script type="text/javascript" src="/angular/angular-cookies.min.js"></script>
// app.js
// inject ngCookies to your app named 'myApp'.
angular.module('myApp', ['ngCookies']);
// controller.js
function MyCtrl($scope, $http, $cookies) {
jeremyjbowers / my_app.conf
Created Dec 31, 2012
This is an upstart configuration file to execute uWSGI as a daemon on Ubuntu-recent (10.x, 12.x). For more info on upstart: This file would live in /etc/init/ and you'd need to do sudo initctl reload-configuration on the initial file creation and then sudo service my_app start/restart/stop to contr…
View my_app.conf
description "uWSGI server for electris CMS"
start on runlevel [2345] # start on all runlevels.
stop on runlevel [!2345] # stop when shutting down.
respawn # respawn if job crashes or is stopped ungracefully.
env DEPLOYMENT_TARGET=production # set any environment variables you like here.
env DJANGO_SETTINGS_FILE=conf/ # more environment variables if you like.
env PYTHONPATH=/home/ubuntu/apps/my_app:/home/ubuntu/.virtualenv/my_app
guillaumepiot / gist:3939452
Created Oct 23, 2012
ANGULARJS - Django CSRF Token header setup
View gist:3939452
var myApp = angular.module('myApp').config(function($httpProvider) {
$['X-CSRFToken'] = $('input[name=csrfmiddlewaretoken]').val();
moklett /
Created Jul 24, 2012
OpenConnect VPN on Mac OS X

Unfortunately, the Cisco AnyConnect client for Mac conflicts with Pow. And by "conflicts", I mean it causes a grey-screen-of-death kernel panic anytime you connect to the VPN and Pow is installed.

As an alternative, there is OpenConnect, a command-line client for Cisco's AnyConnect SSL VPN.

Here's how to get it set up on Mac OS X:

  1. OpenConnect can be installed via homebrew:

     brew update
     brew install openconnect
evildmp / gist:3094281
Last active May 2, 2020
Set up Django, nginx and uwsgi
View gist:3094281

This document has now been incorporated into the uWSGI documentation:

Set up Django, nginx and uwsgi

Steps with explanations to set up a server using:

jezdez / pip.conf
Created Mar 10, 2010
My ~/.pip/pip.conf. More information here:
View pip.conf
default-timeout = 60
respect-virtualenv = true
download-cache = ~/.pip/cache
log-file = ~/.pip/pip.log
build = ~/.pip/build
use-mirrors = true
You can’t perform that action at this time.