Skip to content

Instantly share code, notes, and snippets.

View maggiben's full-sized avatar

Benjamin maggiben

  • Frávega
  • Argentina
View GitHub Profile
@maggiben
maggiben / regions.json
Created February 8, 2017 23:23
This is a list of commonly used acronyms of regional designations used for government, marketing and business purposes.
{
"africa": {
"eastern africa": ["burundi", "comoros", "djibouti", "eritrea", "ethiopia", "kenya", "madagascar", "malawi", "mauritius", "mayotte", "mozambique", "réunion", "rwanda", "seychelles", "somalia", "south sudan", "uganda", "united republic of tanzania", "zambia", "zimbabwe", ""],
"middle africa": ["angola", "cameroon", "central african republic", "chad", "congo", "democratic republic of the congo", "equatorial guinea", "gabon", "sao tome and principe", ""],
"northern africa": ["algeria", "egypt", "libya", "morocco", "sudan", "tunisia", "western sahara", ""],
"southern africa": ["botswana", "lesotho", "namibia", "south africa", "swaziland", ""],
"western africa": ["benin", "burkina faso", "cabo verde", "cote d'ivoire", "gambia", "ghana", "guinea", "guinea-bissau", "liberia", "mali", "mauritania", "niger", "nigeria", "saint helena", "senegal", "sierra leone", "togo", ""],
},
"americas": {
"latin america and the caribbean": [""],
/*
This script is free to use under the license below.
No obligation, but if you use this it I'd love to know, thanks!
Andrew Hedges, [email protected]
-----------------------------------------------------------------------------
The MIT License (MIT)
@maggiben
maggiben / levenshtein.js
Created February 8, 2017 11:51 — forked from hardware/levenshtein.js
Levenshtein distance
/*
Copyright (c) 2006. All Rights reserved.
If you use this script, please email me and let me know, thanks!
Andrew Hedges
andrew (at) hedges (dot) name
If you want to hire me to write JavaScript for you, see my resume.
@maggiben
maggiben / chaining.js
Last active January 30, 2017 20:59
Chain promises
function getUsers() {
return new Promise((resolve, reject) => {
setTimeout(function () {
return resolve('benja')
}, 1000)
})
}
function getIssues(user) {
var issues = {
@maggiben
maggiben / playlist.json
Last active January 5, 2017 14:28
yt-playlist
{
"video": "https://www.youtube.com/watch?v=fNdeLSKSZ1M",
"artist": "Sia",
"title": "Fire Meet Gasoline (by Heidi Klum)"
}, {
"video": "https://www.youtube.com/watch?v=f-BXrRf9_rk",
"artist": "Portugal",
"album": "the man",
"title": "Guns and Dogs"
}
@maggiben
maggiben / index.html
Created November 24, 2016 09:04
3D World (with THREE)
<!DOCTYPE html>
<script src='http://cdnjs.cloudflare.com/ajax/libs/three.js/r82/three.min.js'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/stats.js/r14/Stats.min.js'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/dat-gui/0.5/dat.gui.min.js'></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/tween.js/16.3.5/Tween.min.js"></script>
<script src='orbit.js'></script>
<script>
</script>
@maggiben
maggiben / typeahead.html
Created January 25, 2016 08:40
Aurelia typeahead
<template>
<require from="/styles/type-ahead.css"></require>
<div class="ui icon input">
<input type="text" class="form-control" placeholder.bind="options.placeholder" value.bind="value">
<i class="search link icon"></i>
</div>
</template>

Aurelia-Node

This is a NodeJS Express App bundled with the Skeleton App of the Aurelia platform. It sets up a standard navigation-style app using gulp to build your ES6 code with the babel compiler. Karma/Jasmine testing is also configured.

For more info please visit the official site: http://www.aurelia.io/

Running The App

  1. Fork or download this repo
function download(filename, text) {
var pom = document.createElement('a');
pom.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
pom.setAttribute('download', filename);
if (document.createEvent) {
var event = document.createEvent('MouseEvents');
event.initEvent('click', true, true);
pom.dispatchEvent(event);
{
status: "success",
code: 0,
host: "coreapp-ngapi-prod-2c0bfa9c",
generated_at: "Fri, 06 Nov 2015 19:41:14 +0000",
message: "ok",
data: {
pins: [{
domain: "easyrideme.tumblr.com",
attribution: null,