Skip to content

Instantly share code, notes, and snippets.

View gubatron's full-sized avatar

Angel Leon gubatron

View GitHub Profile
@gubatron
gubatron / adb_logcat_ndk_stack.md
Created September 12, 2021 02:08
How to isolate crashes with `ndk-stack` from `adb logcat` output

adb logcat | ndk-stack -sym <path to folder with .so files>

Example: adb logcat | ndk-stack -sym ~/workspace.frostwire/frostwire-jlibtorrent/swig/bin/release/android/armeabi-v7a

@gubatron
gubatron / random_squares.html
Created August 22, 2021 03:52
Bouncing random colored squares in Javascript using basic canvas 2D api
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Canvas tutorial</title>
<script type="text/javascript">
const max_x = 2048
const max_y = 2048
const bgcolor = 'rgb(0,0,0)'
const fgcolor0 = 'rgb(200, 0, 0)'
@gubatron
gubatron / testListingNetworkInterfaces.java
Created June 26, 2021 01:07
testListingNetworkInterfaces.java
private static void testListingNetworkInterfaces() {
try {
Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces();
NetworkInterface iface;
while (networkInterfaces.hasMoreElements()) {
iface = networkInterfaces.nextElement();
LOG.info("displayName:" + iface.getDisplayName() + " " +
"index:" + iface.getIndex() + " " +
"isUp:" + iface.isUp() + " " +
"isVirtual:" + iface.isVirtual() + " " +

1er Semestre

  • Calculo I
  • Geometría Descriptiva I
  • Lenguaje
  • Humanidades I

2do Semestre

  • Calculo II
  • Geometría Descriptiva II
  • Lógica Computacional
@gubatron
gubatron / Diferenciadores de ADA.md
Created February 27, 2021 04:33
Diferenciadores de ADA

Diferenciadores ADA:

Increíblemente descentralizado y probado matemáticamente tan seguro como Bitcoin. Para cuando llegue el 31 de marzo, toda la red estará completamente operada y será propiedad de la comunidad y el 100% de toda la producción de bloques será manejada por grupos de interés comunitarios.

Rápida, robusta, construida a escala, democracia líquida mediante votación en cadena, abierta a todos. Permite que todo el protocolo sea impulsado por la comunidad y pueda tomar decisiones de una manera más sólida en comparación con el estándar de la industria.

La mejor implementación de metadatos de pila de red en la industria. El modelo Extended-UTXO ofrece a Cardano la capacidad de ejecutar contratos inteligentes de forma segura mientras mantiene la capacidad de escalabilidad.

La tecnología Hard Fork Combinator ofrece actualizaciones / hardforks sin problemas. No hay bifurcaciones obtusas o engorrosas con ADA a diferencia de otras cadenas de bloques que obligan a los usuarios finales a "reclamar" to

@gubatron
gubatron / pascal.hs
Last active January 27, 2021 05:17
Pascal triangle row generator in Haskell
-- Gubatron's method
-- n=3 [1, 2, 1]
-- copy the list and append a 0 on the left of the first
-- and append a 0 at the end of the second
-- [0, 1, 2, 1]
-- [1, 2, 1, 0]
-- add them up!
-- n=4 [1, 3, 3, 1]
--
-- append 0s to both sides and add them up
@gubatron
gubatron / pascal.py
Last active January 27, 2021 16:30
Pascal Triangle Generator in Python
def pascal(n):
if n == 1:
return [ 1 ]
if n == 2:
return [ 1, 1 ]
prev = pascal(n-1)
results = []
for i in range(n):
if i == 0:
continue
@gubatron
gubatron / symlink_all_exes.sh
Created January 14, 2021 17:56
sed: create symlinks to all .exe in a folder
@gubatron
gubatron / Google Sheets - Days of a month
Created November 1, 2020 21:59
Calculate the number of days in a month in Google Sheet.
If cell `B1` had a date indicating the first of the month as in: `=11/1/2020`
To get the number of days of that month you do:
`=DAYS(EOMONTH(B1,0),B1)+1`
@gubatron
gubatron / Entitlements.plist
Last active December 15, 2023 12:52
An example Entitlements.plist file to allow a desktop app to run a Java Runtime Environment on a signed .app
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.disable-executable-page-protection</key>
<true/>