Skip to content

Instantly share code, notes, and snippets.


Franco Gilio fgilio

View GitHub Profile
fgilio / concurrent-pool.php
Last active Aug 23, 2020 — forked from tonysm/concurrent-pool.php
Laravel HTTP client concurrent requests pool
View concurrent-pool.php
// 1. Register the routes
Route::get('test/{lorem}', function ($lorem) {
return response()->json([
'message' => $lorem,
'token' => Str::random(),
fgilio / mercadopago-payment-is-paid.php
Created Dec 11, 2018
MercadoPago check if a payment/merchant order is fully paid
View mercadopago-payment-is-paid.php
* Keep in mind that this is heavily tied to the Laravel Framework
* $client_id
* $client_secret
* $externalReference
fgilio / axios-catch-error.js
Last active Sep 16, 2021
Catch request errors with Axios
View axios-catch-error.js
* Handling Errors using async/await
* Has to be used inside an async function
try {
const response = await axios.get('');
// Success 🎉
} catch (error) {
// Error 😨
fgilio / language-select-with-native-name.html
Created Feb 26, 2017
Language select with native names
View language-select-with-native-name.html
<form class="languages go" method="get" action="#">
<label for="language">Other languages:</label>
<select id="language" class="autosubmit" name="lang">
<option title="English (US)" value="en-US">
English (US) (en-US)
<option title="Afrikaans" value="af">
Afrikaans (af)
<option title="Arabic" value="ar">
// Directly executing ruby
wpscan.rb --url --wordlist darkc0de.lst --username admin
ruby ./wpscan.rb --url --wordlist darkc0de.lst --username admin
ruby ./wpscan.rb --url
ruby ./wpscan.rb -u --wordlist darkc0de.lst --username admin threads 50
ruby wpscan.rb --url --wordlist passwords.txt threads 50
fgilio / remove-onclick.js
Created Sep 29, 2016
Remove onclick attribute from DOM element
View remove-onclick.js
View gitcheats.txt
# shortform git commands
alias g='git'
# get most modified files and counts
git log --all -M -C --name-only --format='format:' "$@" | sort | grep -v '^$' | uniq -c | sort | awk 'BEGIN {print "count\tfile"} {print $1 "\t" $2}' | sort -g
# Locally checkout all remote branches of a repository
git branch -r | cut -d '/' -f2 | grep -Ev '( |master)' | xargs -Ibranch git checkout -b branch origin/branch
# Open current Git repository URL
fgilio / wp-delete-transients.sql
Created Aug 16, 2016
WordPress - Deletes all Transients
View wp-delete-transients.sql
DELETE FROM `wp_options` WHERE `option_name` LIKE ('%\_transient\_%')
fgilio / wp_post_char_lenght_monthly.sql
Created Aug 2, 2016
WordPress average post character length for a given month
View wp_post_char_lenght_monthly.sql
SET @start = '2016-1-01';
SELECT AVG(CHAR_LENGTH(post_content)) AS avgLength
FROM wp_posts
WHERE post_type = 'post'
AND post_status = 'publish'
AND post_date >= @start
AND post_date < @start + INTERVAL 1 MONTH;