Skip to content

Instantly share code, notes, and snippets.

View nlaplante's full-sized avatar

Nicolas Laplante nlaplante

View GitHub Profile
@nlaplante
nlaplante / .atom-build.cson
Created November 26, 2015 17:41
atom-build project configuration for autovala
# main build
cmd: "make"
name: "build"
sh: true
cwd: "{PROJECT_PATH}/install"
keymap: "ctrl-shift-alt-m"
# match warnings & errors from valac and gcc
errorMatch: [
"(?<file>[\\/0-9a-zA-Z\\._\\-]+):(?<line>\\d+):(?<col>\\d+): warning:"
@nlaplante
nlaplante / styles.less
Created June 11, 2015 16:46
Add grid lines background in Atom editor panes
.editor {
background-color: transparent;
background-image:
linear-gradient(0deg, transparent 24%, rgba(255, 255, 255, .05) 25%, rgba(255, 255, 255, .05) 26%, transparent 27%, transparent 74%, rgba(255, 255, 255, .05) 75%, rgba(255, 255, 255, .05) 76%, transparent 77%, transparent),
linear-gradient(90deg, transparent 24%, rgba(255, 255, 255, .05) 25%, rgba(255, 255, 255, .05) 26%, transparent 27%, transparent 74%, rgba(255, 255, 255, .05) 75%, rgba(255, 255, 255, .05) 76%, transparent 77%, transparent);
height:100%;
background-size: 30px 30px;
}
@nlaplante
nlaplante / app.js
Created September 21, 2014 15:41
syslogng-web master heap monitor
/**
* Module dependencies.
*/
var express = require('express'),
routes = require('./routes'),
http = require('http'),
path = require('path'),
mongodb = require('mongodb'),
sio = require('socket.io'),
@nlaplante
nlaplante / gist:6617953
Last active December 23, 2015 09:59
node.js implementation to move files avoiding EXDEV errors when moving files across different devices
'use strict';
var fs = require('fs'),
q = require('q');
/**
* Move a file from src to dest, avoiding cross-device rename failures.
* This method will first try fs.rename and call the supplied callback if it succeeds. Otherwise
* it will pump the conent of src into dest and unlink src upon completion.
*
@nlaplante
nlaplante / gist:4582861
Created January 21, 2013 00:47
Possible fix for floating pointnumber comparison in angular-google-maps https://github.com/nlaplante/angular-google-maps/issues/9
function floatEqual (f1, f2) {
return (Math.abs(f1 - f2) < 0.000001);
}