Skip to content

Instantly share code, notes, and snippets.

Gabriel gabrielstuff

Block or report user

Report or block gabrielstuff

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
@gabrielstuff
gabrielstuff / install.npm.sh
Last active Jan 4, 2019
npm global package
View install.npm.sh
npm install -g auto-install @feathersjs/cli @vue/cli vue-cli budo clibro electron electron-pdf firebase-tools fkill-cli gofetch gulp-cli website-scraper yo ytdl standard nativefier node-gyp npm mammoth speed-test np
@gabrielstuff
gabrielstuff / top-install-software-windows-10.md
Last active Nov 15, 2018
The top software install for a new PC on Windows
View top-install-software-windows-10.md

New windows 10 machine setup

first install bash: https://msdn.microsoft.com/en-us/commandline/wsl/install_guide

Third, install choco, open in elevation mode the cmd (with administrative rights) and copy paste :

@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
@gabrielstuff
gabrielstuff / Setting-loader.md
Last active Mar 14, 2017
📚 A description of what should include a setting module loader
View Setting-loader.md

Setting loader

The setting loader is a module that allows to load settings in the form of a JSON. This JSON file can include various parameters. We call them settings.

The settings should be overridable in the following levels :

  • default settings in a setting folder, in a JSON file. We might use HJSON
  • override settings loaded depending on the ENV : production / staging / development  This overriding should take the following form : load(settings/settings.${ENV}.json) if load(settings/settings.${ENV}.json) fail, tries load(settings/${ENV}.json) else tries load(settings/settings.json)
View sizeof.js
function sizeOf(url, callback) {
var image = new Image();
image.src = url;
image.onload = function () {
callback && callback(null, {width: image.width, height: image.height, ratio: image.width/image.height, img: image})
}
image.onerror = function(){
callback && callback('error')
}
}
@gabrielstuff
gabrielstuff / preLoadInCache.js
Created Dec 15, 2016
Precache images based on JSON response
View preLoadInCache.js
'use strict'
var queue = require('async').queue
var cache = require("imgcache")
var _ = require('lodash')
// query the stories
// query content of eachStories
// then findURLInObject
@gabrielstuff
gabrielstuff / globalTool.json
Last active Oct 15, 2016
Set of global npm
View globalTool.json
{
"bistre":"1.0.1",
"budo":"8.3.0",
"cordova":"6.3.1",
"devtool":"2.0.3",
"firebase-tools":"3.0.7",
"generator-babel-boilerplate":"10.0.1",
"gulp":"3.9.1",
"hihat":"2.6.4",
"hotel":"0.5.4",
@gabrielstuff
gabrielstuff / client.js
Last active Sep 2, 2016 — forked from sahat/client.js
Calculate client-server latency using socket.io
View client.js
var socket = require('socket.io-client')('http://spacebro.space:8080');
var startTime;
setInterval(function() {
socket.emit('latency', Date.now(), function(startTime) {
var latency = Date.now() - startTime;
console.log(latency);
})
}, 2000);
@gabrielstuff
gabrielstuff / bodyframe.json
Last active May 2, 2016
a body frame from kinect
View bodyframe.json
{
"bodies": [
{
"bodyIndex": 0,
"tracked": false
},
{
"bodyIndex": 1,
"tracked": false
},
View earthcontrol.js
require('shelljs/global')
var fs = require('fs')
var handlebars = require('handlebars')
var targz = require('tar.gz')
var file = './pm2-auto.json'
cd('test-settings')
rm('-rf', '.build');
var meteorSettingsFile = fs.readFileSync('./test.json', "utf8")
var pm2startTemplate = handlebars.compile(fs.readFileSync('./pm2-start.tpj', "utf8"))
You can’t perform that action at this time.