Skip to content

Instantly share code, notes, and snippets.

View msenkpiel's full-sized avatar
👻

Marco ± msenkpiel

👻
View GitHub Profile
@graydon
graydon / country-bounding-boxes.py
Created April 23, 2014 00:03
country bounding boxes
# extracted from http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_countries.zip
# under public domain terms
country_bounding_boxes = {
'AF': ('Afghanistan', (60.5284298033, 29.318572496, 75.1580277851, 38.4862816432)),
'AO': ('Angola', (11.6400960629, -17.9306364885, 24.0799052263, -4.43802336998)),
'AL': ('Albania', (19.3044861183, 39.624997667, 21.0200403175, 42.6882473822)),
'AE': ('United Arab Emirates', (51.5795186705, 22.4969475367, 56.3968473651, 26.055464179)),
'AR': ('Argentina', (-73.4154357571, -55.25, -53.628348965, -21.8323104794)),
'AM': ('Armenia', (43.5827458026, 38.7412014837, 46.5057198423, 41.2481285671)),
@yeyus
yeyus / gist:5476308
Created April 28, 2013 08:43
Vagrant curl Bad CPU Type on Core Duo OS X 10.6.8
Vagrant comes with its own curl version at /Application/Vagrant/embedded/bin directory. This curl was compiled against a 64bit machine so you should replace it with a suitable version into your computer...
The stack trace for the error is:
Downloading or copying the box...
/Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/util/subprocess.rb:84:in `rescue in execute': Bad CPU type in executable - curl (Vagrant::Util::Subprocess::LaunchError)
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/util/subprocess.rb:77:in `execute'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/util/subprocess.rb:23:in `execute'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/util/downloader.rb:122:in `block in download!'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/util/busy.rb:19:in `busy'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/util/downloader.rb:121:in `download!'
@jimothyGator
jimothyGator / README.md
Last active April 25, 2024 18:00
Nginx configuration for Mac OS X with Homebrew, using sites-enabled directory.
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
cd /usr/local/etc/nginx/sites-enabled
ln -s ../sites-available/default.conf
ln -s ../sites-available/default-ssl.conf

File locations:

  • nginx.conf to /usr/local/etc/nginx/
  • default.conf and default-ssl.conf to /usr/local/etc/nginx/sites-available
  • homebrew.mxcl.nginx.plist to /Library/LaunchDaemons/
@nijikokun
nijikokun / example-user.js
Created May 3, 2012 20:46
Beautiful Validation... Why have I never thought of this before?!
var user = {
validateCredentials: function (username, password) {
return (
(!(username += '') || username === '') ? { error: "No Username Given.", field: 'name' }
: (!(username += '') || password === '') ? { error: "No Password Given.", field: 'pass' }
: (username.length < 3) ? { error: "Username is less than 3 Characters.", field: 'name' }
: (password.length < 4) ? { error: "Password is less than 4 Characters.", field: 'pass' }
: (!/^([a-z0-9_-]+)$/i.test(username)) ? { error: "Username contains invalid characters.", field: 'name' }
: false
);
@paulirish
paulirish / rAF.js
Last active July 19, 2024 19:50
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@fightbulc
fightbulc / gist:1373235
Created November 17, 2011 14:17
icanhaz updated with mustache 0.4.0-dev
/*!
ICanHaz.js version 0.9 -- by @HenrikJoreteg
More info at: http://icanhazjs.com
*/
(function($) {
/*
mustache.js — Logic-less templates in JavaScript
See http://mustache.github.com/ for more info.
*/
@bastman
bastman / CallbackVO.as
Created November 16, 2011 19:09
jsonrpc client (as3)
package com.application.rpc
{
/**
* ...
* @author seb
*/
public dynamic class CallbackVO extends Object
{
@bastman
bastman / JsonRpc Client (js)
Created November 10, 2011 12:57
advanced json-rpc server (php)
JS Client using jquery ajax and json2.js
========================================
App.invokeRpc = function(method, params, callback)
{
var rpc = {
method:method,
params:params
};
@bastman
bastman / gist:1344759
Created November 7, 2011 11:46
simple jsonrpc server howto php
the request ...
================
{
"method":"foobar",
"params":["foo", "bar", "baz"]
}
@bastman
bastman / MySQLIDB Example
Created November 6, 2011 20:06
MySQLi simple dbclient standalone php
//Example
//=======
ini_set("display_errors", true);
error_reporting(E_ALL|E_STRICT & ~E_NOTICE);
set_error_handler(function($errno, $errstr, $errfile, $errline){
throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
});
$db = MySQLiDB::getInstance();