Skip to content

Instantly share code, notes, and snippets.

View gabrielstuff's full-sized avatar

Gabriel gabrielstuff

View GitHub Profile
@gabrielstuff
gabrielstuff / express.js
Last active August 27, 2023 05:33
express + passport + session / req.session
/**
* Module dependencies.
*/
var express = require('express'),
mongoStore = require('connect-mongo')(express),
flash = require('connect-flash'),
viewHelpers = require('./middlewares/view'),
fs = require('fs'),
upload = require('jquery-file-upload-middleware');
@gabrielstuff
gabrielstuff / jquery.mask.js
Created May 17, 2013 23:00
Using jquery to make a masked element draggable.
/*from http://css-tricks.com/snippets/jquery/draggable-without-jquery-ui/
Added compatibility with iOS touch devices
HTML should be something like :
<div class="container">
<img id="image1" class="erb-image-wrapper" src="test.jpg"> <!-- this is your masked element -->
<img id="image2" class="erb-image-wrapper" src="femme.png" style="cursor: move;"> <!-- this is your mask over the masked element-->
</div>
*/
@gabrielstuff
gabrielstuff / sequence_install.sh
Created January 4, 2012 22:35
Installing afp + avahi + osx = replace SAMBA
apt-get update
apt-get upgrade
apt-get install libcrack2-dev libssl-dev
apt-get install avahi-daemon
apt-get install netatalk
vim /etc/netatalk/AppleVolumes.default
<path_to_share> <sharename> allow:<username> cnidscheme:cdb options:usedots,upriv
@gabrielstuff
gabrielstuff / dmx-web.json
Last active July 13, 2020 13:16
Windows 10 node-dmx getting started
{
"_title": "Light DMX Dashboard",
"server": {
"listen_port": 8080,
"listen_host": "::",
"_uid": "www-data",
"_gid": "www-data"
},
"presets": [
{
@gabrielstuff
gabrielstuff / ffmpeg+mpv-support
Created October 18, 2019 09:25
an install script for ffmpeg + mpv on the raspberry pi 3B+
#!/bin/bash
##### by RPi_Mike
##### https://www.raspberrypi.org/forums/viewtopic.php?f=38&t=199775&sid=b2f3e4ee9032410f3b50354c03641ffb
##### Vidware_Downloads: My script philosophy is to keep things clean and simple. That's why my first step is to create 3 different folders to keep the main elements of my script completely separate from each other. Before anything can be built, we first have to download 6 files in the form of "stable release tarballs". This is the raw source code my script will use to build the 6 programs. We also need 4 GPU-related files from the Raspberry Pi Foundation's official GitHub site that provide OpenGL ES and EGL support (they allow mpv to "talk" to the Raspberry's VideoCore GPU and thus facilitate hardware acceleration). Finally, we need a "waf" file that will allow us to build mpv. All of this will go inside the "Vidware_Downloads" folder – which we're creating with the mkdir command:
mkdir Vidware_Downloads
@gabrielstuff
gabrielstuff / each_with_index.js
Created March 3, 2012 16:00 — forked from burin/each_with_index.coffee
each_with_index handlebars helper, adds an {{index}} prop accessible from within the block
// {{#each_with_index records}}
// <li class="legend_item{{index}}"><span></span>{{Name}}</li>
// {{/each_with_index}}
Handlebars.registerHelper("each_with_index", function(array, fn) {
var total = array.length;
var buffer = "";
for (var i = 0, j = array.length; i < j; i++) {
var item = array[i];
@gabrielstuff
gabrielstuff / install.npm.sh
Last active January 4, 2019 10:02
npm global package
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 November 15, 2018 23:42
The top software install for a new PC on Windows

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'))" &amp;&amp; SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
@gabrielstuff
gabrielstuff / Setting-loader.md
Last active March 14, 2017 10:04
📚 A description of what should include a setting module loader

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)