Skip to content

Instantly share code, notes, and snippets.

@rafakato
rafakato / 2019-https-localhost.md
Created May 23, 2020 04:34 — forked from cecilemuller/2019-https-localhost.md
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@rafakato
rafakato / webstorm-module-alias-fix.js
Last active February 15, 2018 21:14
Workaround Webstorm autocomplete error when using babel module-resolver alias
/* eslint-disable no-undef */
System.config({
paths: {
'pluto-core/*': './src/*',
'pluto-core-config/*': './config/*',
},
});
@rafakato
rafakato / language.js
Created September 9, 2016 18:12
Joi pt-BR language
'use strict';
const internals = {};
exports.errors = {
root: 'value',
key: '"{{!key}}" ',
messages: {
wrapArrays: true
},
@rafakato
rafakato / install_ffmpeg_ubuntu.sh
Created March 15, 2016 20:11 — forked from xdamman/install_ffmpeg_ubuntu.sh
Install latest ffmpeg on ubuntu 12.04 or 14.04
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# Inspired from https://gist.github.com/faleev/3435377
# Remove any existing packages:
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev
# Get the dependencies (Ubuntu Server or headless users):
sudo apt-get update
@rafakato
rafakato / git-live-log.sh
Created August 27, 2015 17:28
livelog (without flickering)
#!/bin/bash
tput civis # hide cursor
#trap "echo test" EXIT # this is not needed actually
watch -n 15 -c -d -t "git --no-pager log \
--graph \
--all \
--pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' \
--abbrev-commit \
--date=relative"
tput cnorm # restore cursor
@rafakato
rafakato / crawler.go
Created July 30, 2014 22:23
Go Crawler
package main
import (
"fmt"
"github.com/PuerkitoBio/goquery"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
"log"
"net/http"
"strconv"
@rafakato
rafakato / autoFillSyncDirective.js
Created July 29, 2014 20:25
AngularJS browser autofill workaround
app.directive('autoFillSync', function($timeout) {
return {
require: 'ngModel',
link: function(scope, elem, attrs, ngModel) {
var origVal = elem.val();
$timeout(function() {
var newVal = elem.val();
if (ngModel.$pristine && origVal !== newVal) {
ngModel.$setViewValue(newVal);
}
[user]
name = <seu_nome>
email = <seu_email>
[color]
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]