Skip to content

Instantly share code, notes, and snippets.

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

Julio J. j3j5

🤷‍♂️
View GitHub Profile
@j3j5
j3j5 / tor_functions.php
Created April 13, 2015 14:34
How to tell if someone is coming from a Tor exit node
// http://www.irongeek.com/i.php?page=security/detect-tor-exit-node-in-php
public function IsTorExitPoint(){
if(gethostbyname(ReverseIPOctets($_SERVER['REMOTE_ADDR']).".".$_SERVER['SERVER_PORT'].".".ReverseIPOctets($_SERVER['SERVER_ADDR']).".ip-port.exitlist.torproject.org")=="127.0.0.2") {
return true;
} else {
return false;
}
}
private function ReverseIPOctets($inputip){
@j3j5
j3j5 / prompt_answer.php
Created April 18, 2015 16:22
PHP snippet to prompt for an answer on the CLI.
function prompt_answer($exit = TRUE) {
$handle = fopen ("php://stdin","r");
$line = fgets($handle);
if(trim($line) !== 'y' && !empty(trim($line))) {
fclose($handle);
if($exit) {
echo "ABORTING!" . PHP_EOL;
exit;
} else {
return FALSE;
@j3j5
j3j5 / gist:8b3e48ccad746b90a54a
Last active November 16, 2023 15:11
Adyen Test Card Numbers
Adyen Test Card Numbers
These cards are only valid on our TEST system and they will never involve any actual transaction or transfer of funds. The TEST card numbers will not work on the Adyen LIVE Platform.
For all cards use the following expiration and CVV2/CVC2/or CID for Amex.
For all cards:
Expiration Dates CVV2 / CVC3 CID (American Express)
08/2018 OR 10/2020 737 7373
ack -l 'TEXTOFIND' --print0 | xargs -0 -n 1 sed -i -e 's/TEXTOFIND/REPLACEWITH/'
<?php
/**
* routes.php would be something like:
*
* Route::get('/my/path/{id}', ['as' => 'ExamplePath', 'uses' => 'ExampleController@getPath']);
*/
// Get the full URL from the current request --> http://example.com/my/path/1
request()->url();
#!/bin/bash
set -eu
if (( $# != 1 )); then
echo "Converts ANIMATED-GIF to a video file."
echo 1>&2
echo "Usage: gif2mp4 ANIMATED-GIF" 1>&2
exit 1
@j3j5
j3j5 / gitolab.php
Created June 23, 2016 16:13 — forked from benoitzohar/gitolab.php
Migrate repositories from Gitolite to GitLab.
#!/usr/bin/php -qC
<?php
/******************************************************************************
*
* @file gitolab.php
* @author Benoit Zohar
* @link http://benoitzohar.fr/
* @last-edited 2015-01-09
* @description Migrate projects from Gitolite to GitLab
@j3j5
j3j5 / a-todo-jazz.csv
Last active April 23, 2024 14:57
A Todo Jazz (todos los programas) (csv y m3u)
We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 6 columns, instead of 1 in line 8.
Título,Tipo,Duración,Popularidad,Fecha,Link
Segunda hora - 04/10/08,Completo,1:00:00,32% popularidad,04 oct 2008,https://rtve-mediavod-lote3.rtve.es/resources/TE_SATODO/mp3/4/7/1223380115374.mp3
Segunda hora - 27/09/08,Completo,1:03:00,32% popularidad,27 sep 2008,
Primera hora - 27/09/08,Completo,1:03:00,32% popularidad,27 sep 2008,https://rtve-mediavod-lote3.rtve.es/resources/TE_SATODO/mp3/9/6/1222521747969.mp3
Segunda hora - 20/09/08,Completo,1:03:00,32% popularidad,20 sep 2008,https://rtve-mediavod-lote3.rtve.es/resources/TE_SATODO/mp3/7/1/1221920506917.mp3
Primera hora - 20/09/08,Completo,1:03:00,32% popularidad,20 sep 2008,https://rtve-mediavod-lote3.rtve.es/resources/TE_SATODO/mp3/4/9/1221916980794.mp3
Segunda hora - 13/09/08,Completo,1:03:00,32% popularidad,13 sep 2008,https://rtve-mediavod-lote3.rtve.es/resources/TE_SATODO/mp3/7/4/1221315742347.mp3
Primera hora - 13/09/08,Completo,1:03:00,32% popularidad,13 sep 2008,https://rtve-mediavod-lote3.rtve.es/resources/TE_SATODO/mp3/5/8/1221312143885.mp3
Segu
@j3j5
j3j5 / jazz-porque-si.csv
Last active April 23, 2024 14:52
Todos los programas de Jazz porque sí en RTVE.es
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 8.
Título,Tipo,Duración,Popularidad,Fecha,Link
"Cab Calloway - 24/10/08",Completo,1:00:34,"32% popularidad","24 oct 2008",https://rtve-mediavod-lote3.rtve.es/resources/TE_SJAZZP/mp3/2/0/1224780860302.mp3
"Dizzy Gillespie - 22/10/08",Completo,1:00:17,"32% popularidad","22 oct 2008",https://rtve-mediavod-lote3.rtve.es/resources/TE_SJAZZP/mp3/0/5/1224583241250.mp3
"Tineke Postma - 20/10/08",Completo,2:00:16,"32% popularidad","20 oct 2008",https://rtve-mediavod-lote3.rtve.es/resources/TE_SJAZZP/mp3/3/1/1224497448413.mp3
"Carsten Daerr - 13/10/08",Completo,2:00:59,"32% popularidad","13 oct 2008",https://rtve-mediavod-lote3.rtve.es/resources/TE_SJAZZP/mp3/3/4/1223901367843.mp3
"Jean-Marie Machado - 01/12/08",Completo,2:00:19,"32% popularidad","01 dic 2008",https://rtve-mediavod-lote3.rtve.es/resources/TE_SJAZZP/mp3/3/0/1227880417803.mp3
"Duke Ellington - 28/11/08",Completo,1:00:30,"32% popularidad","28 nov 2008",https://rtve-mediavod-lote3.rtve.es/resources/TE_SJAZZP/mp3/9/5/1227877220359.mp3
"Charlie Parker - 26/11/0
@j3j5
j3j5 / duendeando.csv
Last active August 8, 2016 14:59
Todos los programas del programa de RNE 3, Duendeando (hasta el 5/8/2016)
Título Tipo Duración Popularidad Fecha Link
Duendeando - 06/12/08 Completo 1:59:33 32% popularidad 06 dic 2008 http://mvod.lvlt.rtve.es/resources/TE_SDUEND/mp3/3/5/1228477463753.mp3
Duendeando - 22/11/08 Completo 2:00:53 32% popularidad 22 nov 2008 http://mvod.lvlt.rtve.es/resources/TE_SDUEND/mp3/7/4/1227190438947.mp3
Duendeando - 15/11/08 Completo 2:00:04 32% popularidad 15 nov 2008 http://mvod.lvlt.rtve.es/resources/TE_SDUEND/mp3/7/8/1226587434987.mp3
Duendeando - 08/11/08 Completo 1:59:56 32% popularidad 08 nov 2008 http://mvod.lvlt.rtve.es/resources/TE_SDUEND/mp3/8/2/1226065380828.mp3
Duendeando - 01/11/08 Completo 2:00:34 32% popularidad 01 nov 2008 http://mvod.lvlt.rtve.es/resources/TE_SDUEND/mp3/6/9/1225705277196.mp3
Duendeando - 25/10/08 Completo 1:59:25 32% popularidad 25 oct 2008 http://mvod.lvlt.rtve.es/resources/TE_SDUEND/mp3/8/6/1224842980068.mp3
Duendeando - 18/10/08 Completo 2:00:36 32% popularidad 18 oct 2008 http://mvod.lvlt.rtve.es/resources/TE_SDUEN