Skip to content

Instantly share code, notes, and snippets.

View juusechec's full-sized avatar
💜
Nubanker - Purple Nation

Jorge Ulises juusechec

💜
Nubanker - Purple Nation
View GitHub Profile
@juusechec
juusechec / install.sh
Last active April 27, 2018 18:58
Universal Install Script https://xkcd.com/1654/
#!/bin/bash
pip install "$1" &
easyinstall "$1" &
brew install "$1" &
npm install "$1" &
yum install "$1" & dnf instal "$1" &
docker run "$1" &
pkg install "$1" &
apt-get install "$1" &
@juusechec
juusechec / sse.go
Created December 22, 2016 13:25
Un script que envía peticiones a un servidor SSE (Server Send Event) recibe peticiones en base16 y las decodifica.
package main
import (
"fmt"
"io"
"log"
"net/http"
"net/url"
//"time"
"crypto/aes"
#!/bin/bash
# rationale: Interfaz eth1 de vagrant no auto inicia
# link: https://glud.org/2017/01/09/interfaz-eth1-de-vagrant-no-auto-inicia/
sudo tee /usr/local/bin/ifupeth1.sh << 'EOF'
#!/bin/bash
sleep 10 && ifup eth1
EOF
sudo chmod +x /usr/local/bin/ifupeth1.sh
sudo tee /usr/lib/systemd/system/ifupeth1.service << 'EOF'
[Unit]
//React Component
import React from 'react';
// Import Style
//import styles from './BannerLogin.css';
// Import Components
var $ = require('jquery');
window.$ = $;
window.jQuery = $;
var iconFeature = new ol.Feature({
geometry: new ol.geom.Point([0, 0]),
name: 'Null Island',
population: 4000,
rainfall: 500
});
var iconFeature2 = new ol.Feature({
geometry: new ol.geom.Point([-1000000, -1000000]),
name: 'Island 2',
const int ledPin = 13;
const int botonPin = 7;
const int boton2Pin = 8;
int milisegundos = 500;
int val = 0;
long randNumber;
long randNumber2;
void setup() {
Serial.begin(9600);
#!/bin/bash -eux
curl -H "Content-Type: application/json" \
-H "X-Gogs-Delivery: 4340a65c-9526-4473-8f07-064dab3ca021" \
-H "X-Gogs-Event: push" -X POST \
-d '{"secret":"ABCD123","ref":"refs/heads/master","before":"bbbbbbb","after":"aaaaaaaaaaaaa","compare_url":"https://gogs.example.com/organization/repository/compare/aaaaaaaaaa...bbbbbbbb","commits":[{"id":"aaaaaa","message":"hi","url":"https://gogs.udistritaloas.edu.co/core/udistrital_core_db/commit/aaaaaaaa","author":{"name":"juusechec","email":"hi","username":""},"committer":{"name":"j","email":"hi@hid","username":""},"timestamp":"2017-05-31T16:52:27Z"},{"id":"aaaaa","message":"COMMITn","url":"https://gogs.domain.net/hola/hi/commit/aaaa","author":{"name":"aaaa","email":"aaa@gmail.com","username":"aaaa"},"committer":{"name":"aaa","email":"aaa@gmail.com","username":"aaa"},"timestamp":"2017-05-30T21:02:31Z"}],"repository":{"id":1,"name":"repo","url":"https://gogs.example.com/org/repo","ssh_url":"ssh://git@gogs.example.com:22/org/repo.git","clone_url":
@juusechec
juusechec / EncryptService.java
Created February 15, 2018 02:37
Class to encrypt and decrypt values in AES algorithm with rando IV saved in convenient BASE64 format.
package co.edu.udistrital.glud.services;
import javax.crypto.spec.SecretKeySpec;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.Cipher;
import java.util.Base64;
import java.util.Random;
@juusechec
juusechec / InverseDirection.py
Last active February 27, 2018 19:47
Test of Actions in QGIS 3
from qgis.utils import iface
#iface.activeLayer().id()
# https://gis.stackexchange.com/questions/91011/how-to-select-and-zoom-in-features-from-a-qgis-python-plugin
layer = iface.mapCanvas().layers()[0]
#layer = QgsProject.instance().mapLayer('waterways20171005162048981')
filter='"osm_id"=' + str([%osm_id%])
r = QgsFeatureRequest().setFilterExpression(filter)
features = layer.getFeatures(r)
# Python Console env
# Get current Layer https://github.com/wfpinedar/typeCapa/blob/master/tipedata.py
layer = iface.activeLayer()
# Name of current layer
layer_name = iface.activeLayer().name()
# Uri of resource layer
iface.activeLayer().dataProvider().dataSourceUri()
# Display Expression of Layer
iface.activeLayer().displayExpression()