Skip to content

Instantly share code, notes, and snippets.

View manduks's full-sized avatar
🥷
Working from home

Armando Gonzalez manduks

🥷
Working from home
View GitHub Profile
@manduks
manduks / response-lsi.json
Last active October 4, 2017 19:37
lsi reponse gist
{
"@context": "/api/contexts/Assessment",
"@id": "/api/assessments/1161937",
"@type": "Assessment",
"id": "1161937",
"createdAt": "2017-10-04T19:08:36+00:00",
"updatedAt": "2017-10-04T19:08:36+00:00",
"completedAt": null,
"productConfiguration": {
"@id": "/api/product_configurations/101",
@manduks
manduks / roles.json
Created August 15, 2017 05:16
a simple json for roles definition
{
modules: {
account: ["canChangePassword", "canUpdateProfile", "canDeleteUser", "..."],
projects: ["canCreate", "...."],
teams: [...],
messages: [...],
Analytics: [...],
Other: [..],
}
teams: {
import React from 'react';
import PropTypes from 'prop-types';
import { Link, withRouter } from 'react-router-dom';
class NavAccordion extends React.PureComponent {
constructor(props) {
super();
this.state = {
showChildren: this.showChildren(props),
};
export const SitiosTaxi = [
{
name: 'Teatro de los Jaguares',
latlong: {latitude: 19.28992168, longitude: -99.04402069},
},
{
name: 'Mariano Matamóros',
latlong: {latitude: 19.290299, longitude: -99.056436},
},
{
export const Rutas = [
{
id: 1,
name: 'Ruta 1',
options: [
{
bicycle: [
{
latitude: 19.289856,
longitude: -99.046576,
@manduks
manduks / kc.js
Last active April 12, 2017 16:06
itemcontextmenu: function(tree, record, item, index, e, eOpts) {
// Optimize : create menu once
var position = e.getXY();
var menu_grid = new Ext.menu.Menu({
items: [{
text: 'More details',
handler: function() {
console.log("Moreils");
}
}]
@manduks
manduks / Utils.js
Created March 7, 2017 20:28
Flattens an array of integers like [[1,2,[3]],4] -> [1,2,3,4].
/**
* Flattens an array of integers like [[1,2,[3]],4] -> [1,2,3,4].
* @param {array} inputArray The array of integers and/or array of integers.
* @returns {array} Flatten array.
*/
function arrayFlatten(inputArray) {
const arrayOfStrings = inputArray.join(',').split(',');
return arrayOfStrings.map(x => parseInt(x, 10));
}
// test arrayFlatten
@manduks
manduks / when.js
Last active December 10, 2016 23:32
TemperatureModule.prototype.when = function(event, callback, value) { // 'medir', callback
temp.on('Measurement',(_value)=>{
if(value === _value) {
callback();
//lcd.home();
//lcd.message("Temp [C]: " + _value.toFixed(2));
}
});
}
temperature.on('medir', function () {
led.turnOn();
}, 23);
light.on('medir', function () {
ledRGB1.turnOn('#FF0000');
}, 12);
humidity.on('medir', function () {
ledRGB2.blink('#00FF00');
}, 12);
distance.on('medir', function () {
@manduks
manduks / tpl
Created November 14, 2016 16:18
{
xtype : 'component',
cls : 'data',
itemId: 'observationSummary',
tpl :[
'<span class="prop">TopBox ID:</span><span class="value">{version}</span>',
'<tpl if="false">',
'<span class="prop js-pkey-label pkey">{pkeyLabel}:</span><span class="value js-pkey-value">{pkey}</span>',
'</tpl>',
'<span class="prop">Agent:</span><span class="value">{agent}</span>'