Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View mellertson's full-sized avatar

Mike Ellertson mellertson

View GitHub Profile
@joninvski
joninvski / bellman.py
Created November 16, 2010 11:31
Bellman ford python implementation
import pdb
"""
The Bellman-Ford algorithm
Graph API:
iter(graph) gives all nodes
iter(graph[u]) gives neighbours of u
graph[u][v] gives weight of edge (u, v)
"""
@gavinwahl
gavinwahl / abcmodel.py
Created December 3, 2013 22:26
Abstract (PEP 3119) Django models.
from abc import ABCMeta, abstractmethod
class AbstractModelMeta(ABCMeta, type(models.Model)):
pass
class ABCModel(models.Model):
__metaclass__ = AbstractModelMeta
class Meta:
@romainl
romainl / gist:9970697
Last active March 21, 2024 09:00
How to use Tim Pope's Pathogen

How to use Tim Pope’s Pathogen

I’ll assume you are on Linux or Mac OSX. For Windows, replace ~/.vim/ with $HOME\vimfiles\ and forward slashes with backward slashes.

The idea

Vim plugins can be single scripts or collections of specialized scripts that you are supposed to put in “standard” locations under your ~/.vim/ directory. Syntax scripts go into ~/.vim/syntax/, plugin scripts go into ~/.vim/plugin, documentation goes into ~/.vim/doc/ and so on. That design can lead to a messy config where it quickly becomes hard to manage your plugins.

This is not the place to explain the technicalities behind Pathogen but the basic concept is quite straightforward: each plugin lives in its own directory under ~/.vim/bundle/, where each directory simulates the standard structure of your ~/.vim/ directory.

@export-mike
export-mike / mcc.json
Last active April 21, 2023 10:45
Stripe MCC.json - https://stripe.com/docs/connect/setting-mcc collected using pup, jq and some manual replacements.
[{
"code": "ac_refrigeration_repair",
"value": "7623",
"name": "A/C Refrigeration Repair"
},
{
"code": "accounting_bookkeeping_services",
"value": "8931",
"name": "Accounting/Bookkeeping Services"
},