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 / GoWorkers.go
Created March 6, 2021 19:10
Go workers example
package main
import (
"fmt"
"time"
)
func printWorker(name string, days int) {
weeks := days / 7
restDays := days % 7
@juusechec
juusechec / tweet-speed-internet.py
Last active January 25, 2021 13:40
Publicar en twitter mi velocidad de internet si este se pierde o si está mucho más abajo de lo vendido
#!/usr/bin/python
# based on: https://arstechnica.com/information-technology/2016/02/comcast-customer-made-bot-that-tweets-at-comcast-when-internet-is-slow/
# twitter access usint this tutorial: https://projects.raspberrypi.org/en/projects/getting-started-with-the-twitter-api/5​​​​​​​​​​​​​​
import os
import sys
import csv
import datetime
import time
import twitter
@juusechec
juusechec / quiz.html
Created January 14, 2021 12:15
What Kind of Productive Person Are You?
<!--
extracted from: https://www.fastcompany.com/3021596/take-the-quiz-what-kind-of-productive-person-are-you
based on lecture of: https://www.fastcompany.com/3021510/most-productive-people-the-art-of-doing-everything
-->
<div>
<div id="fc-quiz">
<p>
Read these nine statements. Type in the number for how much you agree or disagree. When you&#x2019;re done
(you have to answer them all), click &#x201C;Which type am I&#x201D; and share your type with friends.</p>
<p>
// Copyright (c) Ulisses 2019
// License: MIT
// Modified by @juusechec
const Meta = imports.gi.Meta;
const Lang = imports.lang;
const Main = imports.ui.main;
function init(em) {
return new HoppingWindow(em);
#!/usr/bin/env python3
import os
import urllib.request
def create_path(dir):
if not os.path.isdir(dir):
os.mkdir(dir)
def file_exists(file):
return os.path.isfile(file)
# 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()
@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)
@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;
#!/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":"[email protected]","username":"aaaa"},"committer":{"name":"aaa","email":"[email protected]","username":"aaa"},"timestamp":"2017-05-30T21:02:31Z"}],"repository":{"id":1,"name":"repo","url":"https://gogs.example.com/org/repo","ssh_url":"ssh://[email protected]:22/org/repo.git","clone_url":
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);