Skip to content

Instantly share code, notes, and snippets.

View segToIso8601.js
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 Jun 25, 2019
ISO 8601 to seconds
View iso8601.js
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 Jul 6, 2018 — forked from mhawksey/gist:1442370
Google Apps Script to read JSON and write to sheet
View gist:173d0f208195832606b30d8f852a404d
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 Jun 8, 2018
barrier for threads
View barrera.cpp
//============================================================================
// Name : barrera.cpp
// Author : Luis Hernandez
// Version : 1
// Copyright : CodeLouis
// Description : barier for threads
//============================================================================
//g++ 5.4.0
View casa.kml
<?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>
View exportjson.js
// 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 Jul 21, 2016 — forked from anonymous/GAME_MASTER_v0_1.protobuf
Pokemon Go decoded GAME_MASTER protobuf file v0.1
View GAME_MASTER_v0_1.protobuf
Result: 1
Items {
TemplateId: "BADGE_BATTLE_ATTACK_WON"
Badge {
BadgeType: BADGE_BATTLE_ATTACK_WON
BadgeRanks: 4
Targets: "\nd\350\007"
}
}
Items {