Skip to content

Instantly share code, notes, and snippets.

@louismanson
louismanson / segToIso8601.js
Created June 27, 2019 17:37
seconds to ISO 8601
let segToIso8601 = (duaration) => {
let hours;
let minutes;
let seconds;
let result;
if(duaration>3600){
hours = Math.floor(duaration/3600)+"H";
let min = Math.floor(duaration%3600);
@louismanson
louismanson / iso8601.js
Last active June 25, 2019 23:49
ISO 8601 to seconds
let iso8601toSeg = (duaration) => {
let mDuration = [];
let hours = duaration.match(/\d{1,2}[H]/);
let minutes = duaration.match(/\d{1,2}[M]/);
let seconds = duaration.match(/\d{1,2}[S]/);
mDuration['hours'] = hours ? hours[0] : "0H";
mDuration['minutes'] = minutes ? minutes[0] : "0M";
mDuration['seconds'] = seconds ? seconds[0] : "0S";
@louismanson
louismanson / gist:173d0f208195832606b30d8f852a404d
Created July 6, 2018 00:59 — forked from mhawksey/gist:1442370
Google Apps Script to read JSON and write to sheet
function getJSON(aUrl,sheetname) {
//var sheetname = "test";
//var aUrl = "http://pipes.yahoo.com/pipes/pipe.run?_id=286bbb1d8d30f65b54173b3b752fa4d9&_render=json";
var response = UrlFetchApp.fetch(aUrl); // get feed
var dataAll = JSON.parse(response.getContentText()); //
var data = dataAll.value.items;
for (i in data){
data[i].pubDate = new Date(data[i].pubDate);
data[i].start = data[i].pubDate;
}
@louismanson
louismanson / barrera.cpp
Last active June 8, 2018 15:34
barrier for threads
//============================================================================
// Name : barrera.cpp
// Author : Luis Hernandez
// Version : 1
// Copyright : CodeLouis
// Description : barier for threads
//============================================================================
//g++ 5.4.0
<?xml version='1.0' encoding='UTF-8'?>
<kml xmlns='http://www.opengis.net/kml/2.2'>
<Document>
<name>mi casa</name>
<description><![CDATA[]]></description>
<Folder>
<name>casa 1</name>
<Placemark>
<name>Casa luis</name>
<description><![CDATA[<img src="https://lh4.googleusercontent.com/-ofdNO3pODP_FiYFiLy-T1czwHTPSl1PnL7rNCG3edsz-2XB1aXZSs_cozaboKphAvHRTdr3XDIvjKJrVBUnELfUewN794p6vmYcVUpuOhauVa0TXek7Z2SLq6GuN-kX" height="200" width="auto" /><br><br>402H]]></description>
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
@louismanson
louismanson / GAME_MASTER_v0_1.protobuf
Created July 21, 2016 22:21 — forked from anonymous/GAME_MASTER_v0_1.protobuf
Pokemon Go decoded GAME_MASTER protobuf file v0.1
Result: 1
Items {
TemplateId: "BADGE_BATTLE_ATTACK_WON"
Badge {
BadgeType: BADGE_BATTLE_ATTACK_WON
BadgeRanks: 4
Targets: "\nd\350\007"
}
}
Items {