Skip to content

Instantly share code, notes, and snippets.

View nikvdp's full-sized avatar

Nik nikvdp

View GitHub Profile
@nikvdp
nikvdp / left.json
Created February 12, 2016 07:55 — forked from benjamine/left.json
Json Diff Example
{
"name": "South America",
"summary": "South America (Spanish: América del Sur, Sudamérica or Suramérica; Portuguese: América do Sul; Quechua and Aymara: Urin Awya Yala; Guarani: Ñembyamérika; Dutch: Zuid-Amerika; French: Amérique du Sud) is a continent situated in the Western Hemisphere, mostly in the Southern Hemisphere, with a relatively small portion in the Northern Hemisphere. The continent is also considered a subcontinent of the Americas.[2][3] It is bordered on the west by the Pacific Ocean and on the north and east by the Atlantic Ocean; North America and the Caribbean Sea lie to the northwest. It includes twelve countries: Argentina, Bolivia, Brazil, Chile, Colombia, Ecuador, Guyana, Paraguay, Peru, Suriname, Uruguay, and Venezuela. The South American nations that border the Caribbean Sea”including Colombia, Venezuela, Guyana, Suriname, as well as French Guiana, which is an overseas region of France”are also known as Caribbean South America. South America has an area of 17,840,000 square kilome
@nikvdp
nikvdp / splitArray.js
Created January 20, 2016 20:03
Split's an array into array's of n length
/**
*
* Split the array into arrays of n each,
* e.g. if n is 2 [1,2,3,4,5,6] becomes [[1,2], [3,4], [5,6]
*
* @param inputArr - Array
* @param n - Number
*/
function splitBy(inputArr, n) {
var result = [];

Ctags with Sublime Text and Coffeescript

Get Ctags

Step one is to install Exuberant Ctags on your system. For those on an Ubuntu system, this is as simple as:

sudo apt-get install ctags

Get the Sublime Text Plug-in

@nikvdp
nikvdp / merge-ovpn-keys.sh
Last active January 4, 2021 08:13
Merges separated ovpn scripts into one
#!/bin/bash
#######################################################################
# Taken from: https://www.dropbox.com/s/v228zvccef9d10c/merge.sh
# Latest versions of Openvpn supports inline certs and keys
# so you have one client script, instead of script plus 4 keys and certs
#
# This tool assumes
# 1) Openvpn script and certs plus keys are in same directory
# 2) Certs are usually specified in Openvpn script like
# ca ca.crt
#!/usr/bin/env bash
##################################################################################
# ubuntu_auto_netselector.sh #
# #
# This script will automatically get list of ubuntu mirrors, choose the fastest #
# one and optionally modify your /etc/apt/sources.list to use it. #
# #
##################################################################################
@nikvdp
nikvdp / DefaultKeyBinding.dict
Created June 20, 2013 09:07
Config file to sets up full emacs bindings throughout OS X (including ctrl keys)
/* (mostly) Full Emacs style key bindings for any OS X (Cocoa) app
*
* to use save this file to ~/Library/KeyBindings/DefaultKeyBinding.dict
* (will need to create the ~/Library/KeyBindings/ folder first)
*
* If you want to set up your own bindings take a look at Apple's documentation
* for NSResponder:
* https://developer.apple.com/library/mac/#documentation/cocoa/reference/ApplicationKit/Classes/NSResponder_Class/Reference/Reference.html
*
* Originally from: