Skip to content

Instantly share code, notes, and snippets.

Nicolas Talle Nicolab

Block or report user

Report or block Nicolab

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Nicolab /
Created Jan 17, 2020
Multi-line eval for Crystal lang. Write multi-line Crystal code in the stdin / terminal and eval it.

Eval multi-line code in stdin (terminal or SHELL script):

You can just write to crystal eval's stdin if you don't provide any arguments. Or no source argument, to be precise.

Just close stdin to eval it. Depends on you terminal, but usually Ctrl+D.

Another way:

Nicolab /
Created Jan 23, 2018 — forked from ilourt/
Start script to use with systemd to take into account env var
# Absolute path to this script, e.g. /home/user/bin/
SCRIPT=$(readlink -f "$0")
# Absolute path this script is in, thus /home/user/bin
export $(cat ${SCRIPTPATH}/.env | xargs)
docker-compose -f ${SCRIPTPATH}/docker-compose.yml up
Nicolab / SassMeister-input.scss
Created Sep 28, 2017 — forked from pascalduez/SassMeister-input.scss
Some Sass string functions: capitalize, ucwords, camelize, ...
View SassMeister-input.scss
// ----
// Sass (v3.3.4)
// Compass (v1.0.0.alpha.18)
// ----
// Capitalize string
// --------------------------------------------------------------------------------
// @param [string] $string
// --------------------------------------------------------------------------------
// @return [string]
Nicolab / import-github-labels.js
Created Sep 28, 2016 — forked from Isaddo/import-github-labels.js
import github labels via console command
View import-github-labels.js
Go on your labels page (
Edit the following label array
Use this snippet to export github labels (
and replace it
Paste this script in your console
Press Enter!!
Nicolab / update-json.js
Last active Aug 29, 2015
Example of updateJson() with promise
View update-json.js
var promise = require('bluebird');
var fs = primise.promisifyAll(require('fs'));
function updateJson(ticker, value) {
fs.readFileAsync('stocktest.json', 'utf8')
.then(function(contents) {
var stocksJson = JSON.parse(contents);
function traverse() {
find $1 -mindepth 1 -maxdepth 1 ! -type d -exec echo "$2"{} \;
for d in $(find $1 -mindepth 1 -maxdepth 1 -type d ! -name ".")
# if you just need files comment out next line
echo "$2$d"
traverse "$d" "${2} "
Nicolab / webpack.js
Created Jul 22, 2014
Webpack + Angular
View webpack.js
gulp.task('angu.webpack', ['angu.assets-js-clean'], function() {
return gulp.src('main.js')
entry: {
main: paths.client + '/app/main/index.js',
user: paths.client + '/app/user/index.js'
// other entries ...
output: {
View app.js
//app.js Socket IO Test
var app = require('express').createServer(),
redis = require(''),
io = require('').listen(app);
var pub = redis.createClient(port, "url");
var sub = redis.createClient(port, "url");
var store = redis.createClient(port, "url");
pub.auth('pass', function(){console.log("adentro! pub")});
sub.auth('pass', function(){console.log("adentro! sub")});
View gist:10252452
var injector = angular.injector(['module1', module2, 'ng']);
var service = injector.get("serviceName");
View SocketStream.publish.spy.js
// Example test that spies on calls
// Using Mocha to drive:
// sinon.js for stubs/mocks/spies:
// should.js for assertions:
var sinon = require('sinon')
, should = require('should')
, ss = require('socketstream').start();
describe("Spying on SocketStream for testing", function() {
You can’t perform that action at this time.