Skip to content

Instantly share code, notes, and snippets.

View kamicut's full-sized avatar
🐛
does the user think it's fixed?

Marc Farra kamicut

🐛
does the user think it's fixed?
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kamicut
kamicut / oauth.js
Created October 31, 2018 21:47
auth with openstreetmap
function(token, tokenSecret, ctx, cb) {
var OAuth = new require("oauth").OAuth;
var parser = require('xml2json');
var oauth = new OAuth(ctx.requestTokenURL, ctx.accessTokenURL, ctx.client_id, ctx.client_secret, "1.0", null, "HMAC-SHA1");
oauth.get("https://api.openstreetmap.org/api/0.6/user/details", token, tokenSecret, function(e, xml, r) {
console.log(xml);
if (e) return cb(e);
if (r.statusCode !== 200) return cb(new Error("StatusCode: " + r.statusCode));
try {
var jsonResp = JSON.parse(parser.toJson(xml));
@kamicut
kamicut / index.js
Created June 19, 2017 19:18
requirebin sketch
var rp = require('request-promise');
var countrycodes = require('i18n-iso-countries')
var markup = require('json-markup')
var data = {
"countries": [
{
"id": 1,
"name": "Alaska",
"code": "USA-AK",
@kamicut
kamicut / index.js
Created June 19, 2017 19:04
requirebin sketch
var rp = require('request-promise');
var countrycodes = require('i18n-iso-countries')
rp('https://raw.githubusercontent.com/tripviss/osm-countries-geojson/master/config/iso3166-1-alpha2_to_osm.json')
.then(function (data) {
var countries = JSON.parse(data);
var newcountries = {}
document.write('<ul>')
Object.keys(countries).forEach(function (iso2) {
@kamicut
kamicut / keybase.md
Created July 13, 2016 20:30
keybase.md

Keybase proof

I hereby claim:

  • I am kamicut on github.
  • I am kamicut (https://keybase.io/kamicut) on keybase.
  • I have a public key whose fingerprint is EECB 1032 0E4F 8087 0475 E5B0 A0F9 5A47 AD28 2A50

To claim this, I am signing this object:

@kamicut
kamicut / overpass.geojson
Created April 29, 2016 19:54 — forked from anonymous/overpass.geojson
data exported by overpass turbo
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.