Skip to content

Instantly share code, notes, and snippets.

View nmaxcom's full-sized avatar
🙃

Neithan nmaxcom

🙃
  • Barcelona, Spain
View GitHub Profile
@nmaxcom
nmaxcom / gulpfile.js
Created November 1, 2018 14:18
How to make a Gulpfile use different inputs and outputs keeping DRY?
/*
This is the barebones proof of concept:
*/
const gulp = require('gulp');
const p = {
dashboard: {
orig: ['public/dashboard/scss/style.scss', 'public/dashboard/styles/*.css'],
dest: 'public/dashboard/css/',
@alirezas
alirezas / fade.js
Created February 13, 2017 10:54
fadeIn & fadeOut in vanilla js
function fadeOut(el){
el.style.opacity = 1;
(function fade() {
if ((el.style.opacity -= .1) < 0) {
el.style.display = "none";
} else {
requestAnimationFrame(fade);
}
})();
window.test = tape;
// Concatenative inheritance example;
var Animal = {
animalName: 'animal',
describe: function() {
return 'This is an ' + this.animalName + '. ';
}
};
@nl5887
nl5887 / transfer.fish
Last active March 22, 2022 09:07
Bash and zsh alias for transfer.sh. Transfers files and directories to transfer.sh.
function transfer
if test (count $argv) -eq 0
echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"
return 1
end
## get temporarily filename, output is written to this file show progress can be showed
set tmpfile ( mktemp -t transferXXX )
## upload stdin or file
@LeCoupa
LeCoupa / nodejs-cheatsheet.js
Last active June 30, 2024 04:14
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@danburzo
danburzo / README.md
Last active July 29, 2021 08:41
Get all event listeners on the page in Google Chrome
@willurd
willurd / web-servers.md
Last active July 3, 2024 13:20
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@ericelliott
ericelliott / getenv.js
Created November 9, 2012 00:54
dump environment settings to console from node
var env = process.env;
Object.keys(env).forEach(function(key) {
console.log('export ' + key + '="' + env[key] +'"');
});