Skip to content

Instantly share code, notes, and snippets.

View fgilio's full-sized avatar

Franco Gilio fgilio

View GitHub Profile
@fgilio
fgilio / .gitlab-ci.yml
Last active February 20, 2023 17:25
Override Laravel Vapor's Secrets management
stages:
- deploy
.setup_staging_env_file: &setup_staging_env_file |
echo "$STAGING_SECRETS" > staging_secrets.php
.setup_production_env_file: &setup_production_env_file |
echo "$PRODUCTION_SECRETS" > production_secrets.php
staging:
@fgilio
fgilio / concurrent-pool.php
Last active February 22, 2022 13:08 — forked from tonysm/concurrent-pool.php
Laravel HTTP client concurrent requests pool
<?php
// 1. Register the routes
Route::get('test/{lorem}', function ($lorem) {
sleep(3);
return response()->json([
'message' => $lorem,
'token' => Str::random(),
]);
@fgilio
fgilio / mercadopago-payment-is-paid.php
Created December 11, 2018 23:13
MercadoPago check if a payment/merchant order is fully paid
<?php
/*
* Keep in mind that this is heavily tied to the Laravel Framework
*
* $client_id
* $client_secret
* $externalReference
*/
MercadoPago\SDK::setClientId($client_id);
@fgilio
fgilio / axios-catch-error.js
Last active April 11, 2024 19:02
Catch request errors with Axios
/*
* Handling Errors using async/await
* Has to be used inside an async function
*/
try {
const response = await axios.get('https://your.site/api/v1/bla/ble/bli');
// Success 🎉
console.log(response);
} catch (error) {
// Error 😨
@fgilio
fgilio / language-select-with-native-name.html
Created February 26, 2017 16:22
Language select with native names
<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>
<option title="Afrikaans" value="af">
Afrikaans (af)
</option>
<option title="Arabic" value="ar">
@fgilio
fgilio / wpscan-tests.sh
Created October 16, 2016 03:03
WPScan Tests
// Directly executing ruby
wpscan.rb --url https://website.com --wordlist darkc0de.lst --username admin
ruby ./wpscan.rb --url https://website.com --wordlist darkc0de.lst --username admin
ruby ./wpscan.rb --url https://website.com
ruby ./wpscan.rb -u https://website.com --wordlist darkc0de.lst --username admin threads 50
ruby wpscan.rb --url https://website.com --wordlist passwords.txt threads 50
@fgilio
fgilio / remove-onclick.js
Created September 29, 2016 16:01
Remove onclick attribute from DOM element
document.getElementById('remove-onclick').removeAttribute("onclick");
@fgilio
fgilio / gitcheats.txt
Created September 26, 2016 15:34 — forked from chrismccoy/gitcheats.txt
git cheats
# 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
fgilio / wp-delete-transients.sql
Created August 16, 2016 18:11
WordPress - Deletes all Transients
DELETE FROM `wp_options` WHERE `option_name` LIKE ('%\_transient\_%')