Skip to content

Instantly share code, notes, and snippets.

JuanPablo juanpabloaj

Block or report user

Report or block juanpabloaj

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
xolan / plug_traefik.ex
Created Jul 18, 2018
Handle X-Forwarded-Prefix with Plug.Traefik
View plug_traefik.ex
defmodule Plug.Traefik do
use Plug.Builder
@assets_dir System.cwd <> "/priv/web/assets/"
plug Plug.Static, at: "/assets", from: @assets_dir
plug :x_forwarded_prefix
def x_forwarded_prefix(conn, _) do
register_before_send(conn, fn(conn) ->
varmanishant /
Last active Feb 15, 2019
Install Neovim on Centos 6 from source
# Prerequisites
sudo yum -y install libtool autoconf automake cmake gcc gcc-c++ make pkgconfig unzip
# Installation Folder
mkdir -p ~/packages
cd ~/packages
# Source
git clone
cd neovim
# Build
jirikuncar /
Last active Apr 10, 2019
Traefik - header matching

Traefik routing

Proxy to services based on Accept header.


docker-compose up -d


webgefrickel /
Created Apr 26, 2016
Compiling vim on Ubuntu 16 with LUA-support
# Remove previous installations
sudo apt-get remove vim vim-runtime vim-tiny vim-common
# Install dependencies
sudo apt-get install libncurses5-dev python-dev libperl-dev ruby-dev liblua5.2-dev
# Fix liblua paths
sudo ln -s /usr/include/lua5.2 /usr/include/lua
sudo ln -s /usr/lib/x86_64-linux-gnu/ /usr/local/lib/
Restuta /
Last active Jun 18, 2019
Sizes of JS frameworks, just minified + minified and gzipped, (React, Angular 2, Vue, Ember)

Below is the list of modern JS frameworks and almost frameworks – Angular, Ember and React.

All files were downloaded from and named accordingly. Output from ls command is stripped out (irrelevant stuff)

As-is (minified)

$ ls -lhS
566K Jan  4 22:03 angular2.min.js
katowulf / app.js
Last active Dec 20, 2017
Simple paginate example in AngularFire with Firebase.util (
View app.js
var app = angular.module('app', ['firebase']);
app.controller('ctrl', function($scope, $pageArray) {
$scope.pageItems = $pageArray(ref, 'number');
app.factory('$pageArray', function($firebaseArray) {
return function(ref, field) {
// create a Paginate reference
var pageRef = new Firebase.util.Paginate(ref, field, {maxCacheSize: 250});
rcknr /
Last active May 24, 2018
This is a sample code to upload a PDF file to Google Drive with OCR in Apps Script. uploadPdfOcr function returns a File object. To run the code provide a developer key for an API Console project with Drive API service enabled.
function uploadPdfOcr() {
var key = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; // <-- developer key
var file = UrlFetchApp.fetch("").getBlob();
var metadata = { title: file.getName() }
var params = {method:"post",
oAuthServiceName: "drive",
oAuthUseToken: "always",
contentType: "application/pdf",
contentLength: file.getBytes().length,

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

# remap prefix to Control + a
sjl / gist:1240857
Created Sep 25, 2011
Snow Leopard-compiled DVTM binaries (for Lion users)
View gist:1240857
mhayes / gist:984326
Created May 21, 2011 — forked from kirs/gist:984320
broken rakefile
View gist:984326
require File.expand_path('../config/application', __FILE__)
require 'rake'
module ::Dpp
class Application
include Rake::DSL
module ::RakeFileUtils
You can’t perform that action at this time.