Skip to content

Instantly share code, notes, and snippets.

View fgilio's full-sized avatar

Franco Gilio fgilio

View GitHub Profile
@fgilio
fgilio / script.js
Created September 9, 2024 11:31
Bulk delete AWS DynamoDB items from AWS console
// Define a function that performs the desired actions
function executeActions() {
console.log("Executing actions...");
document.querySelector('[aria-label="Items selection"] input').click();
document.querySelector('button[id^=awsui-button-dropdown__trigger]').click();
document.querySelector('[data-testid="DELETE_ITEM_BUTTON_ID"]').click();
document.querySelector('[data-testid="submit-form"]').click();
console.log("Actions executed.");
}
@fgilio
fgilio / gitlab-mr-expand-and-collapse-all.css
Created September 2, 2024 11:41
GitLab MR "Expand and Collapse all"
.gitlab-mreca-top-0 {
top: 0 !important;
}
.gitlab-mreca-mr-version-controls-sticky {
position: sticky;
top: 72px;
z-index: 999;
padding-bottom: 3px;
background-color: white;
@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 August 15, 2024 01:45
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");