Skip to content

Instantly share code, notes, and snippets.

View wouterds's full-sized avatar
:octocat:
Hello world!

Wouter wouterds

:octocat:
Hello world!
View GitHub Profile
@wouterds
wouterds / raspbian-netinstall-basic-setup.sh
Last active August 29, 2015 14:25
raspbian-netinstall-basic-setup.sh
# Configure timezone
dpkg-reconfigure tzdata
# Configure locales
dpkg-reconfigure locales
# Get rid of the annoying locale warnings when installing stuff
echo "" >> ~/.bashrc
echo "export LANGUAGE=\"en_US.UTF-8\"" >> ~/.bashrc
echo "export LC_ALL=\"en_US.UTF-8\"" >> ~/.bashrc
@wouterds
wouterds / slow-downloader.php
Last active August 29, 2015 14:24
Simulate slow downloads. Usage: slow-downloader.php?path=static/videos/intro.mp4
<?php
// 128KB/100ms
$ms = 100;
$size = 128;
$path = $_GET['path'];
if (empty($path)) {
return;
}
@wouterds
wouterds / Gulpfile.js
Created June 28, 2015 09:24
Personal Gulpfile barebone
/**
* Gulpfile
*/
var Gulpfile = function() {
// Paths
var paths = {
dest: 'public/**/',
scripts: {
src: 'resources/scripts/',
// delegate
#define UIAppDelegate (AppDelegate *)[[UIApplication sharedApplication] delegate]
#define APPDELEGATE ((AppDelegate *)[[UIApplication sharedApplication] delegate])
// system
#define IS_IPHONE_4INCH (UI_USER_INTERFACE_IDIOM()==UIUserInterfaceIdiomPhone && [UIScreen mainScreen].bounds.size.height==568)
#define IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
// screen size
#define IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
@wouterds
wouterds / postalCodeMapping.php
Last active August 29, 2015 14:22
postalCodeMapping.php
<?php
public function provinceByPostalCode($postalCode)
{
$province = null;
if ($postalCode >= 1000 && $postalCode < 1300) {
$province = 'brussels';
} else if ($postalCode < 1500) {
$province = 'walloon-brabant';
var Checkbox = function($el) {
var _this = this;
var init = function() {
};
var nogEenPrivateFunction = function() {
};
@wouterds
wouterds / convert-mapstylejson-to-urlargs.php
Created January 27, 2015 14:42
Convert google maps style json to url arguments to use for google maps static images.
<?php
public function mapStylesUrlArgs($mapStyleJson)
{
$params = [];
foreach (json_decode($mapStyleJson, true) as $style) {
$styleString = '';
if (isset($style['stylers']) && count($style['stylers']) > 0) {
@wouterds
wouterds / countr_code.js
Created January 27, 2015 10:26
Country code prefix object
var CountryCodePrefix = {
'AF': 93, 'AL': 355, 'DZ': 213, 'AS': 1684, 'AD': 376, 'AO': 244, 'AI': 1264,
'AQ': 0, 'AG': 1268, 'AR': 54, 'AM': 374, 'AW': 297, 'AU': 61, 'AT': 43,
'AZ': 994, 'BS': 1242, 'BH': 973, 'BD': 880, 'BB': 1246, 'BY': 375, 'BE': 32,
'BZ': 501, 'BJ': 229, 'BM': 1441, 'BT': 975, 'BO': 591, 'BA': 387, 'BW': 267,
'BV': 0, 'BR': 55, 'IO': 246, 'BN': 673, 'BG': 359, 'BF': 226, 'BI': 257,
'KH': 855, 'CM': 237, 'CA': 1, 'CV': 238, 'KY': 1345, 'CF': 236, 'TD': 235,
'CL': 56, 'CN': 86, 'CX': 61, 'CC': 672, 'CO': 57, 'KM': 269, 'CG': 242,
'CD': 242, 'CK': 682, 'CR': 506, 'CI': 225, 'HR': 385, 'CU': 53, 'CY': 357,
'CZ': 420, 'DK': 45, 'DJ': 253, 'DM': 1767, 'DO': 1809, 'EC': 593, 'EG': 20,
-- phpMyAdmin SQL Dump
-- version 3.4.11.1deb2+deb7u1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jan 20, 2015 at 01:42 PM
-- Server version: 5.5.40
-- PHP Version: 5.4.36-0+deb7u3
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";