Skip to content

Instantly share code, notes, and snippets.

View UlisesGascon's full-sized avatar
😎
Focus on FOSS Projects!

Ulises Gascón UlisesGascon

😎
Focus on FOSS Projects!
View GitHub Profile
@UlisesGascon
UlisesGascon / Raspi_local_mac.md
Last active October 22, 2016 23:10
Localizar Raspberry Pi en red local usando Mac

1 - Instalar nmap

brew install nmap

2 - Buscar por eliminación

sudo nmap -sP 192.168.1.0/24 | awk '/^Nmap/{ip=$NF}/B8:27:EB/{print ip}'

3 - Conexión SSH

@UlisesGascon
UlisesGascon / conversion.js
Created March 7, 2016 19:01
Conversion tiempo ms -> Horas, minutos, segundos y dias
var t = Date.parse(endtime) - Date.parse(new Date());
var seconds = Math.floor((t / 1000) % 60);
var minutes = Math.floor((t / 1000 / 60) % 60);
var hours = Math.floor((t / (1000 * 60 * 60)) % 24);
var days = Math.floor(t / (1000 * 60 * 60 * 24));
@UlisesGascon
UlisesGascon / gatitos.js
Created March 31, 2016 16:25
Cambiar las fotos de Genbeta por fotos de gatitos
var imagenes = document.querySelectorAll('.article-home-figure img');
var imagenesLog = [];
for(var i = 0; i < imagenes.length; i++){
var url = document.querySelectorAll('.article-home-figure img')[i].src;
var ancho = document.querySelectorAll('.article-home-figure img')[i].width;
var alto = document.querySelectorAll('.article-home-figure img')[i].height;
var sustituto = "http://lorempixel.com/"+ancho+"/"+alto+"/cats";
var datos = [url, ancho, alto, sustituto]
imagenesLog.push(datos);
document.querySelectorAll('.article-home-figure img')[i].src = sustituto;
@UlisesGascon
UlisesGascon / NANO_Drivers.md
Last active May 1, 2016 10:53
Drivers Arduino Nano Compatible para Linux, Mac y Windows
@UlisesGascon
UlisesGascon / terremotos.js
Last active May 14, 2016 08:48
Terremotos de la última hora detectados por el USGS en un script ejecutable de Node.js. Puedes filtrar con el parámetro (all, 1.0, 2.5, 4.5, significant)
#!/usr/bin/env node
var http = require('http');
if (!process.argv[2]) {
console.error('Necesito un parámetro para afinar mis resultados');
process.exit(1);
} else {
if (process.argv[2] !== "all" &&
process.argv[2] !== "1.0" &&
@UlisesGascon
UlisesGascon / bootstrap-starter-template.html
Created July 13, 2016 08:59
Bootstrap starter-template with cdnjs
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
@UlisesGascon
UlisesGascon / simple_jquery.js
Created July 27, 2016 17:36
Simple Ajax Management
function updateHTML (datosdb){
console.log("Data from Ajax request: ", datosdb);
/*
-- UPDATE HTML --
*/
}
function errorDatos (err){
console.warn("Error in Ajax Request: ", err);
/*
@UlisesGascon
UlisesGascon / Gruntfile.js
Last active October 4, 2016 09:45
KOA_visualizer_C9
'use strict';
module.exports = function(grunt) {
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
grunt.initConfig({
karma: {
options: {
configFile: 'karma.conf.js'
},
unit: {
@UlisesGascon
UlisesGascon / bower.json
Created September 14, 2016 09:26
[KOA DOCS] Spinner - Complex Example
{
"name": "koapp-spinner-doc-complex",
"authors": "Ulises Gascón",
"description": "Documentation complex sample spinner for King of App",
"main": "koapp-spinner-doc-complex.html",
"moduleType": [
"globals"
],
"keywords": [
"kingofapp",
@UlisesGascon
UlisesGascon / bower.json
Created September 14, 2016 10:38
[KOA DOCS] Spinner - Example
{
"name": "koapp-spinner-doc-simple",
"authors": "Ulises Gascón",
"description": "Documentation simple sample spinner for King of App",
"main": "koapp-spinner-doc-simple.html",
"moduleType": [
"globals"
],
"keywords": [
"kingofapp",