Skip to content

Instantly share code, notes, and snippets.


Javier Blanco Gutiérrez jbgutierrez

View GitHub Profile

Best practices for building Vim plugins

2016-11-05 VimConf 2016

kremalicious /
Last active Jun 26, 2022
Install and configure Tor as proxy for all OpenVPN server traffic
# what we want:
# client -> OpenVPN -> Tor -> Internet
# Install & configure OpenVPN
# assumed OpenVPN configuration
# tun0-Interface
Vestride /
Last active Jun 20, 2022
Encoding video for the web

Encoding Video


Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
t2k /
Last active Aug 29, 2015
Async Parallel Image Processing
mongoose = require "mongoose"
Busboy = require "busboy"
secrets = require "../config/secrets"
GridStream = require "gridfs-stream"
Files = require "../models/files"
sharp = require "sharp"
async = require "async"
gmccreight / master.vim
Last active Mar 24, 2022
A script that gives you a playground for mastering vim
View master.vim
" copy all this into a vim buffer, save it, then...
" source the file by typing :so %
" Now the vim buffer acts like a specialized application for mastering vim
" There are two queues, Study and Known. Depending how confident you feel
" about the item you are currently learning, you can move it down several
" positions, all the way to the end of the Study queue, or to the Known
" queue.
" type ,, (that's comma comma)
jedi4ever /
Last active May 28, 2022
nodejs clustering, zero downtime deployment solutions

Clustering: The basics

The trick? pass the file descriptor from a parent process and have the server.listen reuse that descriptor. So multiprocess in their own memory space (but with ENV shared usually)

It does not balance, it leaves it to the kernel.

In the last nodejs > 0.8 there is a cluster module (functional although marked experimental)

avdi / fib.rb
Created Jul 15, 2013
Fibonacci example from "Programming Elixir" translated to Ruby
View fib.rb
require 'thread'
require 'benchmark'
module FibSolver
def self.fib(scheduler_queue, my_queue)
loop do
scheduler_queue << [:ready, my_queue]
message, *args = my_queue.pop
case message
when :fib
jimweirich / cpu.rb
Last active Dec 18, 2015
Can people run this script and see if it gives accurate count of CPUs on their system. Report results in the comments please. Thanks! Oh! And don't forget to report what kind of system you are running this on (linux, windows, mac, etc.). UPDATE: Revised version that uses the Java runtime if running under JRuby.
View cpu.rb
require 'rbconfig'
# Based on a script at:
class CpuCounter
def self.count
def count
creationix / output.log
Created May 8, 2013
Working version of generator async code sample. Using node from
View output.log
tim@touchsmart:~/Code$ nvm use v0.11.2-generators
Now using node v0.11.2-generators
tim@touchsmart:~/Code$ node --harmony testgen.js
<Buffer 76 61 72 20 66 73 20 3d 20 72 65 71 75 69 72 65 28 27 66 73 27 29 3b 0a 66 75 6e 63 74 69 6f 6e 20 72 65 61 64 46 69 6c 65 28 70 61 74 68 2c 20 65 6e 63 ...>
Sleeping for 2000ms...
algal / nginx-cors.conf
Created Apr 29, 2013
nginx configuration for CORS (Cross-Origin Resource Sharing), with an origin whitelist, and HTTP Basic Access authentication allowed
View nginx-cors.conf
# A CORS (Cross-Origin Resouce Sharing) config for nginx
# == Purpose
# This nginx configuration enables CORS requests in the following way:
# - enables CORS just for origins on a whitelist specified by a regular expression
# - CORS preflight request (OPTIONS) are responded immediately
# - Access-Control-Allow-Credentials=true for GET and POST requests