Skip to content

Instantly share code, notes, and snippets.

View quin2's full-sized avatar

Quinn Vinlove quin2

View GitHub Profile
@kunanit
kunanit / pandas_postgres.py
Created April 24, 2017 14:36
Read postgres database table into pandas dataframe
import pandas as pd
from sqlalchemy import create_engine
# follows django database settings format, replace with your own settings
DATABASES = {
'production':{
'NAME': 'dbname',
'USER': 'user',
'PASSWORD': 'pass',
'HOST': 'rdsname.clqksfdibzsj.us-east-1.rds.amazonaws.com',
@jpierson
jpierson / switch-local-git-repo-to-fork.md
Last active December 26, 2022 21:48 — forked from jagregory/gist:710671
How to move to a fork after cloning

If you are like me you find yourself cloning a repo, making some proposed changes and then deciding to later contributing back using the GitHub Flow convention. Below is a set of instructions I've developed for myself on how to deal with this scenario and an explanation of why it matters based on jagregory's gist.

To follow GitHub flow you should really have created a fork initially as a public representation of the forked repository and the clone that instead. My understanding is that the typical setup would have your local repository pointing to your fork as origin and the original forked repository as upstream so that you can use these keywords in other git commands.

  1. Clone some repo (you've probably already done this step)

    git clone git@github...some-repo.git
# -*- mode: gitignore; -*-
# This file was mostly stitched together from a bunch of gitignore files
# found at https://github.com/github/gitignore and is customized for my
# OS X setup.
# Emacs stuff #
###############
*~
\#*\#
@mrysav
mrysav / benchmark-ec2-boottime.sh
Last active May 20, 2019 21:43 — forked from andsens/benchmark-ec2-boottime.sh
Starts a single instance and measures the time until SSH connectivity
#!/bin/bash -e
# Make sure awscli is configured correctly ("aws configure")
ami_id='ami-60b6c60a' # amazon linux
availability_zone='us-east-1b'
keypair="KEYPAIR_NAME"
keypath="PATH_TO_PEM_FILE"
instance_type="t2.micro"
sg_id="sg-YOURS"
subnet_id="subnet-YOURS"
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'threading_design.ui'
#
# Created: Thu Aug 6 13:47:18 2015
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
@andsens
andsens / benchmark-ec2-boottime.sh
Created October 1, 2012 19:02
Starts a single instance and measures the time until SSH connectivity
#!/bin/bash -e
# These need to be set.
#export EC2_HOME="/path/to/ec2-api-tools"
#export AWS_ACCESS_KEY='XXXXXXXXXXXXXXXXXXXX'
#export AWS_SECRET_KEY='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
#export PATH="$PATH:${EC2_HOME}/bin"
ami_id='ami-123abc12'
availability_zone='eu-west-1a'
keypair="johndoe@example.com"