Skip to content

Instantly share code, notes, and snippets.

View ikarius6's full-sized avatar

Mr.Jack ikarius6

  • México
View GitHub Profile
//Model: Expense.php
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Expense extends Model
{
protected $fillable = [
'source_id', 'expense_category_id', 'quantity', 'note'
];
@ikarius6
ikarius6 / json13.php
Last active September 13, 2019 21:33
Programmer's day on Friday 13 average years - JSON Voorhees
<?php
//Programmer's day on Friday 13 average years - JSON Voorhees
$r=$i=0;
for ($y=$ly=0; $y<3000; $y++) {
$d = new DateTime();
$d->setDate($y, 1, 256);
if ($d->format("D") == "Fri" && $d->format('d') == 13) {
$r += $y - $ly;
$ly = $y;
$i++;
@ikarius6
ikarius6 / icc_replace.php
Created April 2, 2018 07:00
Replacing display metadata in bulk for ICC files, from mntrRGB to scnrRGB, requires folders files and final - Mr.Jack
<?php
/*
Replacing display metadata in bulk for ICC files, from mntrRGB to scnrRGB - Mr.Jack
*/
$read_folder = "./files/";
$write_folder = "./final/";
$scanned_directory = array_diff(scandir($read_folder), array('..', '.'));
foreach($scanned_directory as $file){
echo "<p>Converting ".$file." - ";
@ikarius6
ikarius6 / redneuronal.php
Created October 26, 2017 05:57
Red Neuronal - PHP
<?php
/*
Red Neuronal 3x12x8x2 - Mr.Jack - 10/2017
3 neuronas de entrada
2 capas intermedias
12 neuronas escondidas en la capa 1
8 neuronas escondidas en la capa 2
2 neuronas de salida
*/
class RedNeuronal{
function Invoke-UACBypass {
<#
.SYNOPSIS
Bypasses UAC on Windows 10 by abusing the SilentCleanup task to win a race condition, allowing for a DLL hijack without a privileged file copy.
Author: Matthew Graeber (@mattifestation), Matt Nelson (@enigma0x3)
License: BSD 3-Clause
Required Dependencies: None
Optional Dependencies: None
@ikarius6
ikarius6 / evolucion.php
Created June 24, 2016 20:56
Algoritmo evolutivo sencillo en PHP - Mr.Jack
<!DOCTYPE html>
<meta charset="UTF-8">
<h1>Algoritmo evolutivo sencillo en PHP - Mr.Jack</h1><hr/>
<?php
$objetivo = array(1,2,3,4,5);
$poblacion = array();
function generar_poblacion( $individuo_base = null ){
global $poblacion;
if(empty($individuo_base)){
@ikarius6
ikarius6 / pass_regex_validation.html
Created April 29, 2016 17:46
A regex to validate passwords with at least a capital, a digit and of 8 length using positive lookahead
<pre id="test"></pre>
<script>
/*
Password validation with regex by Mr.Jack (github.com/ikarius6)
At least 1 capital
At least 1 number
Minimum length of 8 characters
Demo: https://jsfiddle.net/h5sutweh/
*/
@ikarius6
ikarius6 / pokemon.php
Last active April 13, 2016 23:25
Getting GIFs of pokemons (1 hour lazy script), separed by national (n_*) and johto (j_*) numbers
<?php
/*
Getting GIFs of pokemons by Jack
*/
set_time_limit( 0 );
$dwl_folder = "./img"; //edit this
$p1 = get("http://es.pokemon.wikia.com/wiki/Lista_de_Pok%C3%A9mon_de_la_primera_generaci%C3%B3n");
preg_match_all('/<table class="tabpokemon sortable mergetable" style="text-align:center; width:100%;">(?<trs>.*?)<\/table>/si', $p1['response'], $matches);
@ikarius6
ikarius6 / clue_test.html
Created April 6, 2016 22:35
Where can I walk step by step? - on JS - by Jack
<script>
/*
Where can I walk step by step? - by Jack
0 = can walk
1 = a wall
Other numbers > padding = steps
*/
var map = [
<?php
/*
OAuthSimple by jr conlin
http://unitedHeroes.net/OAuthSimple
Refactor to PHP by MrJack.org
*/
class OAuthSimple
{
private $_secrets=[];
private $_default_signature_method= "HMAC-SHA1";