Skip to content

Instantly share code, notes, and snippets.

View saschwarz's full-sized avatar
💭
Making things!

Steve Schwarz saschwarz

💭
Making things!
View GitHub Profile
@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
@johanndt
johanndt / upgrade-postgres-9.3-to-9.5.md
Last active July 15, 2022 12:35 — forked from dideler/upgrade-postgres-9.3-to-9.4.md
Upgrading PostgreSQL from 9.3 to 9.5 on Ubuntu

TL;DR

Install Postgres 9.5, and then:

sudo pg_dropcluster 9.5 main --stop
sudo pg_upgradecluster 9.3 main
sudo pg_dropcluster 9.3 main
@AllThingsSmitty
AllThingsSmitty / script-loaded.js
Created May 5, 2015 13:25
Check if any given script has loaded
var myScript = document.createElement('script');
myScript.src = 'http://code.jquery.com/jquery-2.1.4.min.js';
myScript.onload = function() {
console.log('jQuery loaded.');
};
document.body.appendChild(myScript);
@hyperking
hyperking / Pelican Jinja Date Extension
Last active November 8, 2016 16:49
Pelican Jinja Date extension and conditional for comparing current datetime to object date.
This will format python datetime as a string to be used within jinja conditionals for comparing current date to article date using pelican app.
1. Create a file named jinjaext.py
2. paste the following snippet
def convertdate(datetime, format='%a-%d-%m-%Y'):
return datetime.date().strftime(format)
3. Add the following line to your config file
@njvack
njvack / catmullrom2bezier.js
Created October 10, 2013 21:01
A routine to compute the cubic Bézier spline parameters to fit a curve to points, using the Catmull-Rom algorithm.
//************************************************
//
// Catmull-Rom Spline to Bezier Spline Converter
//
//
// This is an experimental extension of the SVG 'path' element syntax to
// allow Catmull-Rom splines, which differs from Bézier curves in that all
// defined points on a Catmull-Rom spline are on the path itself.
//
// This is intended to serve as a proof-of-concept toward inclusion of a