Skip to content

Instantly share code, notes, and snippets.

@effection
effection / gist:6117224
Created July 30, 2013 21:36
Convert all line endings to unix. Doesn't harm binaries
#!/bin/sh
zip -qr foo.zip "$@" && unzip -aqo foo.zip && rm foo.zip
@effection
effection / class-macro.js
Last active January 8, 2016 13:37 — forked from disnet/gist:5267782
Better class macro in Sweet.js
/**
* class which allows 'private' (just non-enumerable prototype object) methods and variables
*/
macro class {
case $className { constructor $constParam { $constBodyStatement... } public var {$public_vars ...} private var $private_vars $rest ... } => {
var $className = (function() {
function $className $constParam {
$public_vars ... Object.defineProperty(this, '_private_vars', { configurable: true, enumerable: false, value: $private_vars, writable: false})