Skip to content

Instantly share code, notes, and snippets.

View juanpujol's full-sized avatar
🇧🇷
Always Working Remotely

Juan Pujol juanpujol

🇧🇷
Always Working Remotely
View GitHub Profile
@juanpujol
juanpujol / ids.json
Created September 23, 2023 13:00
tjsc-ids
This file has been truncated, but you can view the full file.
["321693875503821541605741745032","321693875503821541605741994984","321693870016215140655265575938","321693870016215140655286442703","321693870016215140655286533135","321693870016215140655286612080","321693870016215140655286701100","321693870016215140655286790540","321693870016215140655264812372","321693870016215140655264975374","321693870016215140655265117619","321693870016215140655265206032","321693870016215140655265363386","321693600107322272676852964172","321693600107322272676853253027","321693600107322272676853354491","321693600107322272676853537041","321693600107322272676853647553","321693600107322272676853847925","321693600107322272676853976436","321693600107322272676854099897","321693600107322272676854211000","321693600107322272676854295538","321693600107322272676854466385","321693600107322272676854613860","321693600107322272676854870288","321693600107322272676855125204","321693600107322272676855455515","321693600107322272676855661996","321693600107322272676856047905","321693600107322272676856164706",
@juanpujol
juanpujol / init.sh
Last active April 14, 2021 21:56
Initial script to prepare development machine
#!/bin/bash
echo "===> Update & Upgrade Ubuntu"\n
sudo apt-get update
sudo apt-get upgrade -y
echo "===> Install Docker"
sudo curl -fsSL https://get.docker.com -o get-docker.sh | sh
@juanpujol
juanpujol / es-english-analyzer.json
Created November 6, 2017 16:21
Elasticsearch english analyzer
"settings": {
"analysis": {
"filter": {
"english_stop": {
"type": "stop",
"stopwords": [
"a",
"about",
"above",
"after",
@juanpujol
juanpujol / mbta-loop.js
Last active January 23, 2017 19:19
MBTA Realtime example
const normalizedCollection = [];
newHook.result.mode.forEach((mode) => {
const feature = {
mode: mode.mode_name,
locality: 'Boston',
stateCode: 'MA',
geometry: {
type: 'Point',
coordinates: [],
@juanpujol
juanpujol / aurelia-redirect.js
Last active January 1, 2017 22:20
Aurelia redirect
this.router.navigateToRoute('your-route-name', {
id: 'this.your-identifier'
}, {
replace: true,
trigger: false
});
@juanpujol
juanpujol / DOCS.md
Created September 17, 2016 23:46
Building Service Docs

Beakyn Buildings Service

This services is in charge of finding buildings and keept a sync reference with POIs.

Request and response logic

Responses will be always in geoJSON format and will return as FeatureCollection with Features of type GeometryCollection, which include a polygon or multipolygon at index 0 and a point at index 1.

If a single building is requested using an ID the response will be a geoJSON of type Feature.

@juanpujol
juanpujol / esConnector_destroyAll.js
Last active August 7, 2016 00:40
loopback-connector-es destroyAll fix for v2.x
/**
* Delete model instances by query
* @param {String} modelName name
* @param {String} whereClause criteria
* @param {Function} cb callback
*/
ESConnector.prototype.destroyAll = function destroyAll(modelName, whereClause, cb) {
var self = this;
if ((!cb) && _.isFunction(whereClause)) {
@juanpujol
juanpujol / google-timezone.js
Last active May 16, 2016 16:00
Node.js Google timezone API wrapper
'use strict'
const request = require('request-promise');
module.exports = TimeZone;
function TimeZone(options) {
if(!options.apiKey) {
throw new Error('api key is required');
}
@juanpujol
juanpujol / google-geocoder.js
Last active May 16, 2016 15:57
Node.js Google Maps geocode API wrapper
'use strict'
const request = require('request-promise');
module.exports = Geocoder;
function Geocoder(options) {
if(!options.apiKey) {
throw new Error('api key is required');
}
@juanpujol
juanpujol / osm-geocoder.js
Last active May 16, 2016 16:01
Node.js OpenStreetMap geocode and reverse geocode API wrapper
'use strict'
const request = require('request-promise');
module.exports = Geocoder;
function Geocoder() {
if (!(this instanceof Geocoder)) {
return new Geocoder();
}