Skip to content

Instantly share code, notes, and snippets.

View kozie's full-sized avatar

Koos van Egmond kozie

View GitHub Profile
@kozie
kozie / gulpfile.coffee
Created February 5, 2016 08:35
Gulpfile im using with Gulp 4 with error notifying and plumber
gulp = require 'gulp'
babel = require 'gulp-babel'
sourcemaps = require 'gulp-sourcemaps'
concat = require 'gulp-concat'
uglify = require 'gulp-uglify'
sass = require 'gulp-sass'
minCss = require 'gulp-minify-css'
prefix = require 'gulp-autoprefixer'
@kozie
kozie / member_init.cpp
Created October 15, 2015 06:22
member_init.cpp
class Derp
{
public:
Derp() : number_(0) {}
private:
int number_;
}
class Derp
This is what i have now
===========
FirstEntry
SecondEntry
ThirdEntry
Desired result
==============
// Easy way to convert the above list to the following
@kozie
kozie / gist:9923220
Created April 1, 2014 21:06
'var that = this' vs. 'Function.call'
MyObjectThingy.prototype.someFunction = function () {
var that = this;
OtherObject.doSomethingWithACallback(123, function () {
that.done();
});
};
MyObjectThingy.prototype.someFunction = function () {
OtherObject.doSomethingWithACallback(123, function () {
@kozie
kozie / BlueTransImgDataUrl
Created October 28, 2013 12:08
Create Blue Transparent Base64 Img URL
var e = document.createElement("canvas")
var c = e.getContext("2d");
e.width = 1
e.height = 1
var d = c.getImageData(0, 0, 1, 1);
d.data[0] = 0; // R
@kozie
kozie / index.js
Created March 27, 2013 11:32
voxel.js game
var createGame = require('voxel-engine')
function sphereWorld(x, y, z) {
// return the index of the material you want to show up
// 0 is air
//if (x*x + y*y + z*z > 15*15) return 0
if (y != 0 || x > 10 || x < -10 || z > 10 || z < -10) return 0
return 3
}
@kozie
kozie / gist:4593355
Last active December 11, 2015 11:28
Simple Magento test (index) file for debugging
<?php
require_once 'app/Mage.php';
// Set some debugging flags
Varien_Profiler::enable();
Mage::setIsDeveloperMode(true);
ini_set('display_errors', 1);
// Initialize Magento