Skip to content

Instantly share code, notes, and snippets.

View marciopuga's full-sized avatar

Marcio Puga marciopuga

View GitHub Profile
{
"extends": "airbnb"
}
@marciopuga
marciopuga / tmux-cheatsheet.markdown
Created April 25, 2016 12:53 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
{
"libs": [
"browser",
"jquery"
],
"loadEagerly": [
"importantfile.js"
],
"plugins": {
"requirejs": {
@marciopuga
marciopuga / setup.conf
Last active September 22, 2016 16:25
nginx setup jekyll for clear URL using try_files
server {
listen 80;
server_name www.puga.com.br puga.com.br;
location / {
try_files $uri/ $uri/index.html $uri.html $uri =404;
root /home/marcio/puga.com.br;
}
}
@marciopuga
marciopuga / vimdiff.md
Created October 12, 2016 20:55
vimdiff cheat sheet

vimdiff cheat sheet

##git mergetool

In the middle file (future merged file), you can navigate between conflicts with ]c and [c.

Choose which version you want to keep with :diffget //2 or :diffget //3 (the //2 and //3 are unique identifiers for the target/master copy and the merge/branch copy file names).

:diffupdate (to remove leftover spacing issues)

:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)

@marciopuga
marciopuga / factory-shared.es5.js
Created November 8, 2016 20:39 — forked from PatrickJS/factory-shared.es5.js
Different examples of OOP "class" with "inheritance" done using JavaScript including languages that transpile into js. Take notice to the amount of boilerplate that's needed in ES5 compared to ES6. These examples all have the same interface with pros/cons for each pattern. If they seem similar that's whole point especially the difference between…
var EventEmitter = require('events').EventEmitter;
var _ = require('lodash');
// Factory shared
var makePerson = function() {
var person = {};
EventEmitter.call(person);
person.wallet = 0;
_.extend(person, personMethods)
return person;
@marciopuga
marciopuga / docker-compose.yml for development
Last active May 8, 2017 01:49
Microservices running on Docker reverse proxy using Traefik, Docker Swarm and Docker Compose v3
version: '3'
services:
traefik:
image: marciopuga/traefik:latest
build: ./traefik/.
command: --web --docker --docker.domain=docker.localhost --docker.watch \
--logLevel=DEBUG \
--docker.exposedbydefault=false \
--entryPoints='Name:http Address::80' \
--defaultEntryPoints='http'
@marciopuga
marciopuga / gist:d27b85de52f78f86c368c96f292a1008
Created October 11, 2018 05:02
Remove all docker dangling images
docker rmi $(docker images --quiet --filter "dangling=true")
@marciopuga
marciopuga / gist:e0c36878d76eb9a6f90caae030a0547d
Created January 30, 2019 01:49
Update package.json with all newer packages
Using npm-check-updates
https://github.com/tjunnone/npm-check-updates
`npm install -g npm-check-updates`
`ncu -u`
@marciopuga
marciopuga / index.js
Created March 26, 2019 04:45
Send POST request using Vanilla Node.js
const http = require('http')
const options = {
hostname: 'localhost',
port: 3000,
path: '/path',
method: 'POST',
headers: {
'Content-Type': 'application/json'
}
}