Skip to content

Instantly share code, notes, and snippets.

@jbenet
jbenet / simple-git-branching-model.md
Last active April 9, 2024 03:31
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@RobertAudi
RobertAudi / moc-on-osx.md
Last active September 30, 2023 19:54
This is a walkthrough on how to install the MOC command-line music player on OS X. The procedure was tested in Mountain Lion.

MOC on OS X

I waited for years for a Homebrew formula for MOC. I finally found one today, but it didn't work for me. So I decided to try to compile it from source.

Requirements

Here is a list of requirements, taken directly from the MOC README:

@mariocesar
mariocesar / models.py
Last active December 12, 2015 00:29
Conveniently register model methods as constraints, that will check before saving the model
from functools import wraps
from django.db import models
from django.core.exceptions import ValidationError
class ConstraintModel(models.Model):
class Meta:
abstract = True
def _fill_constraints_register(self):
@lecram
lecram / escher.py
Last active August 27, 2021 07:05
This is a toy one-file application to manage persistent key-value string data. The file is *both* the application and its data. When you run any of the commands described in `escher.py --help`, the file will be executed and, after data change, it will rewrite itself with updated data. You can copy the file with whatever name to create multiple d…
#! /usr/bin/env python
"""{escher} -- one-file key-value storage.
What?
This is a toy application to manage persistent key-value string data.
The file {escher} is *both* the application and its data.
When you run any of the commands below, the file will be executed and,
after data change, it will rewrite itself with updated data.
You can copy the file with whatever name to create multiple datasets.
@TooTallNate
TooTallNate / mp3player.js
Created October 24, 2012 17:42
node.js command line MP3 player in 9 lines of code!
var fs = require('fs');
var lame = require('lame');
var Speaker = require('speaker');
fs.createReadStream(process.argv[2])
.pipe(new lame.Decoder())
.on('format', function (format) {
this.pipe(new Speaker(format));
});
@michaelcox
michaelcox / SpecRunner.js
Last active January 11, 2024 06:05
Browser Unit Testing with Backbone Mocha Chai and RequireJS
require.config({
baseUrl: '/backbone-tests/',
paths: {
'jquery' : '/app/libs/jquery',
'underscore' : '/app/libs/underscore',
'backbone' : '/app/libs/backbone',
'mocha' : 'libs/mocha',
'chai' : 'libs/chai',
'chai-jquery' : 'libs/chai-jquery',
'models' : '/app/models'
@neojp
neojp / Node.js: Using "supervisor" with "Locomotive"
Created February 16, 2012 19:59
Runs a Locomotive app, listens and auto-reloads server if code changes are found.
# node-supervisor: https://github.com/isaacs/node-supervisor
# locomotive: http://locomotivejs.org/
supervisor --watch app/controllers,config,config/environments,config/initializers -- node_modules/locomotive/bin/lcm.js server
@keesun
keesun / EnableHello.java
Created January 18, 2012 15:18
Spring 3.1's @import & ImportBeanDefinitionRegistrar
@Retention(value = RetentionPolicy.RUNTIME)
@Import(HeloIBDR.class)
public @interface EnableHello {
String name();
}
@clintel
clintel / gist:1155906
Created August 19, 2011 02:40
Fenced code in bullet lists with GitHub-flavoured MarkDown??

Fenced code blocks inside ordered and unordered lists

  1. This is a numbered list.

  2. I'm going to include a fenced code block as part of this bullet:

    Code
    More Code