Skip to content

Instantly share code, notes, and snippets.

@eayoungs
eayoungs / GitHub-Forking.md
Created April 5, 2017 02:10 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@eayoungs
eayoungs / git-feature-workflow.md
Created March 31, 2017 01:15 — forked from blackfalcon/git-feature-workflow.md
Git basics - a general workflow

There are many Git workflows out there, I heavily suggest also reading the atlassian.com [Git Workflow][article] article as there is more detail then presented here.

The two prevailing workflows are [Gitflow][gitflow] and [feature branches][feature]. IMHO, being more of a subscriber to continuous integration, I feel that the feature branch workflow is better suited.

When using Bash in the command line, it leaves a bit to be desired when it comes to awareness of state. I would suggest following these instructions on [setting up GIT Bash autocompletion][git-auto].

Basic branching

When working with a centralized workflow the concepts are simple, master represented the official history and is always deployable. With each now scope of work, aka feature, the developer is to create a new branch. For clarity, make sure to use descriptive names like transaction-fail-message or github-oauth for your branches.

@eayoungs
eayoungs / soda-js-c4sf-enev.js
Last active February 11, 2017 00:40
Soda-Js adapted to C4SF Energy & Env project
/* SODA Library for importing the data-set: https://github.com/socrata/soda-js */
var soda = require('soda-js');
/* get the data and render the page */
var consumer = new soda.Consumer('data.sfgov.gov');
consumer.query()
.withDataset('j2j3-acqj')
.limit(2000)
/* .where({ namelast: 'SMITH' })
#!/usr/bin/env python
# https://data.sfgov.org/resource/75rg-imyz.json
from sodapy import Socrata
client = Socrata("data.sf.gov", "Qcun6a3zIaXVkhdhlCmZF2DCw")
print(client.get("75rg-imyz", limit=2))
@eayoungs
eayoungs / Energy_Monitor_Real.ino
Created October 1, 2016 23:44 — forked from whatnick/Energy_Monitor_Real.ino
ESP8266 Energy Monitor Real Power
/*
* This sketch sends ads1115 current sensor data via HTTP POST request to thingspeak server.
* It needs the following libraries to work (besides the esp8266 standard libraries supplied with the IDE):
*
* - https://github.com/adafruit/Adafruit_ADS1X15
*
* designed to run directly on esp8266-01 module, to where it can be uploaded using this marvelous piece of software:
*
* https://github.com/esp8266/Arduino
*
@eayoungs
eayoungs / ircecho.py
Created August 4, 2016 20:31 — forked from RobertSzkutak/ircecho.py
Echo, a simple IRC bot written in Python 3
#!/usr/bin/env python3
# ircecho.py
# Copyright (C) 2011 : Robert L Szkutak II - http://robertszkutak.com
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
@eayoungs
eayoungs / automation.md
Created June 29, 2016 18:04 — forked from cube-drone/automation.md
Automation For The People

Automation for the People

Long ago, the first time I read "The Pragmatic Programmer", I read some advice that really stuck with me.

"Don't Use Manual Procedures".

This in the chapter on Ubiquitous Automation. To summarize, they want you to automate all the things.

The trouble was that I hadn't much of an idea how to actually go

#List unique values in a DataFrame column
pd.unique(df.column_name.ravel())
#Convert Series datatype to numeric, getting rid of any non-numeric values
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True)
#Grab DataFrame rows where column has certain values
valuelist = ['value1', 'value2', 'value3']
df = df[df.column.isin(value_list)]
@eayoungs
eayoungs / ipython_notebook_in_git.md
Created November 25, 2015 23:32 — forked from pbugnion/ ipython_notebook_in_git.md
Keeping IPython notebooks under Git version control

This gist lets you keep IPython notebooks in git repositories. It tells git to ignore prompt numbers and program outputs when checking that a file has changed.

To use the script, follow the instructions given in the script's docstring.

For further details, read this blogpost.

The procedure outlined here is inspired by this answer on Stack Overflow.

@eayoungs
eayoungs / test_tilt.py
Last active August 29, 2015 14:24
eppy_failed_test
import numpy as np
from math import acos as arccos
from math import sqrt as sqrt
from tinynumpy import array as array
from pytest_helpers import almostequal
import math
def angle2vecs(vec1,vec2):
# vector a * vector b = |a|*|b|* cos(angle between vector a and vector b)
dot = np.dot(vec1,vec2)