Skip to content

Instantly share code, notes, and snippets.

View AlexR1712's full-sized avatar
🏠
Working from home

Alexander J. Rodriguez D. AlexR1712

🏠
Working from home
View GitHub Profile
@AlexR1712
AlexR1712 / bladeCompile.php
Last active December 5, 2022 07:20
Compile a string like Blade Template in Laravel
<?php
// Only you need to add in your controller.
public function bladeCompile($value, array $args = array())
{
$generated = \Blade::compileString($value);
ob_start() and extract($args, EXTR_SKIP);
// We'll include the view contents for parsing within a catcher
// so we can avoid any WSOD errors. If an exception occurs we
@AlexR1712
AlexR1712 / checkSession.php
Last active November 1, 2022 01:43 — forked from lukas-buergi/checkSession.php
Check whether sessions work in php
<?php
error_reporting( E_ALL );
ini_set( 'display_errors', 1);
if(!isset($_GET['action'])){
die('Param is missing. Look at the <a href="https://gist.github.com/2995743">source</a>.');
}
switch($_GET['action']) {
/*************************************************
* This is a simple Monte Carlo simulation to see
* whether we should
* go for X BIG deal and/or Y SMALL deals.
*
* What is the best blend?
*
* Author: Ido Green | plus.google.com/+greenido
* Date: 16 July 2013
*
@AlexR1712
AlexR1712 / docker-install-parrot.sh
Created March 30, 2022 20:40 — forked from nuga99/docker-install-parrot.sh
Install Docker Engine on Parrot OS
#!/bin/sh
# From https://www.hiroom2.com/2017/09/24/parrotsec-3-8-docker-engine-en/
set -e
# Install dependencies.
sudo apt install -y curl apt-transport-https \
software-properties-common ca-certificates
# Install docker.
@AlexR1712
AlexR1712 / Enigma.php
Created October 26, 2017 01:48
PHP Enigma Machine
<?php namespace App\Services;
/**
* A PHP version of the Enigma machine.
* Wikipedia: http://en.wikipedia.org/wiki/Enigma_machine
*
* This might not be an accurate representation. I have never seen, nor used an enigma machine.
* This class was created by reading the article at http://enigma.louisedade.co.uk/howitworks.html.
*
* Usage:
@AlexR1712
AlexR1712 / curl.sh
Created October 24, 2020 16:32 — forked from exAspArk/curl.sh
Test CORS with cURL
curl -I -X OPTIONS \
-H "Origin: http://EXAMPLE.COM" \
-H 'Access-Control-Request-Method: GET' \
http://EXAMPLE.COM/SOMETHING 2>&1 | grep 'Access-Control-Allow-Origin'
@AlexR1712
AlexR1712 / bancos
Created December 27, 2017 20:17 — forked from xombra/bancos
Codigo y Bancos correspondientes de Venezuela
Banco:
<select name="banco">
<option value=""></option>
<option value="0156">100%BANCO</option>
<option value="0196">ABN AMRO BANK</option>
<option value="0172">BANCAMIGA BANCO MICROFINANCIERO, C.A.</option>
<option value="0171">BANCO ACTIVO BANCO COMERCIAL, C.A.</option>
<option value="0166">BANCO AGRICOLA</option>
<option value="0175">BANCO BICENTENARIO</option>
<option value="0128">BANCO CARONI, C.A. BANCO UNIVERSAL</option>
@AlexR1712
AlexR1712 / rename_incremental_order_by_modified_asc_date.sh
Last active August 28, 2019 20:29
Rename files based on the modified date, add incremental number to the begining of the filename.
ls -1rt | cat -n | while read n f; do mv -n "$f" "$n""_""$f"; done
@AlexR1712
AlexR1712 / !WhatsApp On Web Monitor.md
Last active December 13, 2018 14:24 — forked from parthpower/!WhatsApp On Web Monitor.md
Simple JS to monitor offline and online time of a contact.

WhatsApp On Web Monitor

What It does

It gives notifications when someone goes online or offline or typing. Open chat of the contact you want to monitor and start script.

Simple Way

@AlexR1712
AlexR1712 / activity.js
Last active June 2, 2018 01:12
Time Activity
// Script for track user activity in page and out the page
var timeActiveOnSite = 0; // seconds
var timeInactive = 0; // seconds
var lastActivityDatetime;
window.setInterval(function(){
if(document['visibilityState'] === 'visible'){
timeActiveOnSite++;
lastActivityDatetime = Date.now();
} else {
timeInactive++;