Skip to content

Instantly share code, notes, and snippets.

View j3j5's full-sized avatar
🤷‍♂️

Julio J. j3j5

🤷‍♂️
View GitHub Profile
SHOULD MATCH:
http://foo.com/blah_blah
http://foo.com/blah_blah/
http://foo.com/blah_blah_(wikipedia)
http://foo.com/blah_blah_(wikipedia)_(again)
http://www.example.com/wpstyle/?p=364
https://www.example.com/foo/?bar=baz&inga=42&quux
http://✪df.ws/123
http://userid:[email protected]:8080
http://userid:[email protected]:8080/
@j3j5
j3j5 / country_code.php
Last active December 15, 2016 17:38
Get the country name from a ISO country code
<?php
/**
* Copied from http://snipplr.com/view/36868/ for posterity
*/
function country_code_to_country( $code ){
$country = '';
if( $code == 'AF' ) $country = 'Afghanistan';
if( $code == 'AX' ) $country = 'Aland Islands';
if( $code == 'AL' ) $country = 'Albania';
@j3j5
j3j5 / video2gif.sh
Created December 19, 2016 16:40
Convert from video to GIF using ffmpeg
# Replace the parameters on capital letters
ffmpeg -y -ss 30 -t 3 -i EXAMPLE.mp4 -vf fps=10,scale=320:-1:flags=lanczos,palettegen palette.png
ffmpeg -ss START_TIME -t DURATION -i EXAMPLE.mp4 -i palette.png -filter_complex "fps=10,scale=320:-1:flags=lanczos[x];[x][1:v]paletteuse" OUTPUT.gif
@j3j5
j3j5 / clean_all_svgs.sh
Created June 1, 2017 19:02
Apply SVG Cleaner to all the SVGs on a given folder
# https://github.com/RazrFalcon/svgcleaner/ must be installed
find . -type f -name "*.svg" | sudo xargs -I file svgcleaner file file
@j3j5
j3j5 / functions.php
Created August 28, 2017 18:23
Log all SQL queries made from Wordpress
<?php
// Include this on your functions.php
function log_sql_queries($text_query){
/* //Uncomment me if you want a lot of info about where the sql query comes from and what action started it off
$traces = debug_backtrace();
foreach ($traces as $tobj => $trace) {
if($trace['function'] == 'do_action'){
$args = $trace['args'];
}
@j3j5
j3j5 / cloak.ovpn
Created June 28, 2018 00:00 — forked from d3v-null/cloak.ovpn
This is an OpenVPN settings file for Cloak. Forked for compatibility the OpenVPN client in ASUS RT routers
client
dev tun
comp-lzo
auth-user-pass
# remote-cert-tls server
server-poll-timeout 10
auth-nocache
auth-retry interact
verb 1
remote openvpn.getcloakvpn.com 443 udp
@j3j5
j3j5 / varnishlog-examples.sh
Created November 28, 2018 17:48 — forked from cupracer/varnishlog-examples.sh
varnishlog examples (version 4.x)
# filter by request host header
varnishlog -q 'ReqHeader ~ "Host: example.com"'
# filter by request url
varnishlog -q 'ReqURL ~ "^/some/path/"'
# filter by client ip (behind reverse proxy)
varnishlog -q 'ReqHeader ~ "X-Real-IP: .*123.123.123.123"'
# filter by request host header and show request url and referrer header
@j3j5
j3j5 / vacunas-dpto-historical.csv
Last active May 25, 2021 01:14
Vacunación en Uruguay (series históricas)
ARTIGAS CANELONES CERRO LARGO COLONIA DURAZNO FLORES FLORIDA LAVALLEJA MALDONADO MONTEVIDEO PAYSANDÚ RIVERA ROCHA RÍO NEGRO SALTO SAN JOSÉ SORIANO TACUAREMBÓ TREINTA Y TRES
2021-02-27 4 27 3 7 5 1 0 2 22 210 8 26 4 0 26 6 11 9 1
2021-02-28 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2021-03-01 488 1368 778 727 621 244 543 349 1089 7021 545 860 488 465 615 538 574 509 191
2021-03-02 383 1655 266 376 449 243 410 338 415 6788 423 464 303 272 627 407 303 392 177
2021-03-03 493 2131 569 647 507 237 591 359 917 9817 556 716 457 323 669 557 495 757 446
2021-03-04 259 1519 184 203 143 98 200 255 319 3731 232 327 164 123 435 275 165 188 135
2021-03-05 256 1379 204 287 175 65 281 200 374 3953 290 311 4 119 433 222 174 312 157
2021-03-06 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2021-03-07 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
@j3j5
j3j5 / rules-both.iptables
Created May 13, 2021 19:59 — forked from jirutka/rules-both.iptables
Basic iptables template for ordinary servers (both IPv4 and IPv6)
###############################################################################
# The MIT License
#
# Copyright 2012-2014 Jakub Jirutka <[email protected]>.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@j3j5
j3j5 / Equipamiento-Urbano.md
Last active September 1, 2021 14:31
Estadísticas por barrio del dataset de equipamiento urbano - espacios públicos de la intendencia de Montevideo

Equipamiento urbano – espacios públicos

Estadísticas obtenidas de cruzar el dataset de Equipamiento urbano de la Intendencia de Montevideo con la capa "Barrios según INE" del SIG.

BANCOS

Barrio Número de bancos
PUNTA CARRETAS 139
BUCEO 85
MALVIN 80