Skip to content

Instantly share code, notes, and snippets.

@technoweenie
technoweenie / github_oauth_busy_developer_guide.md
Created May 30, 2010 18:34
GitHub OAuth Busy Developer's Guide

GitHub OAuth Busy Developer's Guide

This is a quick guide to OAuth2 support in GitHub for developers. This is still experimental and could change at any moment. This Gist will serve as a living document until it becomes finalized at Develop.GitHub.com.

OAuth2 is a protocol that lets external apps request authorization to private details in your GitHub account without getting your password. All developers need to register their application before getting started.

Web Application Flow

  • Redirect to this link to request GitHub access:
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active June 5, 2024 22:16 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.
@DavidSouther
DavidSouther / gist:5224974
Last active December 15, 2015 07:39
Notes for "Github Workflow"
Github Flow
Central project repository: "upstream"
Developer GH repository: "origin"
Developer local repository: "localhost"
Init:
Project:
Create branches on "upstream"
master
@DavidSouther
DavidSouther / overview.md
Last active April 4, 2016 02:00
Space Naval Sim

cc by-sa 3.0

OUTDATED

It now lives here.

Premise

Take command of a Stellar Naval Vessel (SNV) in a universe with physics from the CoDominium universe. Manage navigation, weapons, science, and more as you lead your crew on various missions ranging from military engagements to interstellar diplomacy to scientific exploration. Earn your place in the admiralty and take on larger missions, eventually controlling armadas and fleets at a galactic level.

    Workflows!
        Internals!
Tips & Tricks! 
  Resolving conflicts!
       Reading git output! 

Git - Top down!

[git-top-down]$ git hub-clone
/home/southerd/.ghf/bin/git-hub-clone <org/repo>: Initialize a new working repository, and set git-hubflow configurations.
<org/repo>: The organization and repository name to clone from.
[git-top-down]$ git hub-clone github-flow/recipes
Fork at https://github.com/DavidSouther/recipes
Project cloned into /home/southerd/devel/southerd/git-top-down/recipes
[git-top-down]$ cd recipes/
[recipes (master)]$ ls
README.md
@rhysrhaven
rhysrhaven / Bash State Machine
Last active December 17, 2022 13:21
Simple bash state machine to re-run script in the same place after failure. Better to use case statement fall through if you have Bash 4.
#!/bin/bash
LOL=/tmp/LOLZ
RUNNING=true
while $RUNNING; do
case $([ -f $LOL ] && cat $LOL) in
INIT)
echo "Reached INIT State. Moving to WORK state."
echo "WORK" > $LOL
@hideshi
hideshi / sqlite3.awk
Created December 28, 2013 11:43
How to use SQLite3 in Awk.
#!/usr/bin/awk -f
BEGIN {
db = "test.db"
command = "sqlite3 -noheader -separator \" \" " db " \" %s \""
create_table = "create table employee (id, name, age)"
insert1 = "insert into employee values (1, 'taro', 20)"
insert2 = "insert into employee values (2, 'hanako', 18)"
insert3 = "insert into employee values (3, 'ichiro', 26)"
select = "select * from employee order by age"
drop_table = "drop table employee"
@stephanh42
stephanh42 / hexutil.py
Last active July 12, 2022 17:02
Utility functions for hex grids, in Python 3.
"""
Utility functions for hex grids.
"""
from math import sqrt
from heapq import heappush, heappop
import numpy
import numpy.random
neighbours = numpy.array(((2, 0), (1, 1), (-1, 1), (-2, 0), (-1, -1), (1, -1)))
@urschrei
urschrei / hexgrid.py
Last active May 4, 2022 11:57
Python Hexgrid
import math
def calculate_polygons(startx, starty, endx, endy, radius):
"""
Calculate a grid of hexagon coordinates of the given radius
given lower-left and upper-right coordinates
Returns a list of lists containing 6 tuples of x, y point coordinates
These can be used to construct valid regular hexagonal polygons