Skip to content

Instantly share code, notes, and snippets.

@tomaskikutis
tomaskikutis / gist:517657c4675ce580b1f7
Created February 10, 2015 12:15
GULP task for compiling HTMLBARS templates for use in the browser
var htmlbars = require("gulp-htmlbars");
var tap = require("gulp-tap");
var concat = require("gulp-concat");
var getTemplateNameFromPath = function(path){
// if exist replace \ with /
while( path.indexOf("\\") !== -1 ){
path = path.replace("\\", "/");
}
@bvssvni
bvssvni / gist:9674632
Last active December 23, 2023 22:56
A Rust Chain Macro
//! Chain macro in Rust
//!
//! A typical usage is to avoid nested match expressions.
//!
//! Supports:
//! - Pattern matching
//! - Or expressions (A | B => ...)
//! - Guarded statements (x if <cond> => ...)
//! - Implicit else (requires all arms to return same type)
@emberian
emberian / baz.rs
Last active January 1, 2016 19:49 — forked from klutzy/trace.rs
pub fn h(x: ||) { x() }
@madjar
madjar / json.rs
Created October 20, 2013 21:53
A nice Json wrapper for rust
/*
* Hi there !
*
* I found that handling Json was quite annoying, so I wrote this
* little lib to help. You can find an example of the usage in the
* tests at the end.
*
* I lacked inspiration on the naming of value() and item(), and got
* lost in the lifetimes, so from_json takes a Json and not a
* JsonLike.
@jbenet
jbenet / simple-git-branching-model.md
Last active November 9, 2024 04:55
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.

@mebens
mebens / camera.lua
Created May 8, 2011 20:52
Example code for part 3 of my Cameras in Love2D tutorial series.
camera = {}
camera._x = 0
camera._y = 0
camera.scaleX = 1
camera.scaleY = 1
camera.rotation = 0
function camera:set()
love.graphics.push()
love.graphics.rotate(-self.rotation)
@liamoc
liamoc / gist:762380
Created January 2, 2011 07:30
Creating Tables in C
#include <stdio.h>
/* BEGIN HACKERY */
typedef struct field {
enum {
TABLE_NAME,
TABLE_FIELD,
TABLE_TERMINATOR
} tag;