Skip to content

Instantly share code, notes, and snippets.

View yoelpc4's full-sized avatar
🚀
Make something out of nothing

Yoel Peter Chandra yoelpc4

🚀
Make something out of nothing
View GitHub Profile
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
@yoelpc4
yoelpc4 / pagination.css
Created August 6, 2021 20:16
Oxygen Repeater Pagination Fix
.oxy-repeater-pages-wrap {
grid-column: 1 / -1;
}

Keybase proof

I hereby claim:

  • I am yoelpc4 on github.
  • I am yoelpc4 (https://keybase.io/yoelpc4) on keybase.
  • I have a public key ASA4vch6VrrbhYQJWelxfIq8kSXAQXj0Uz4Lo2S1_bX4PAo

To claim this, I am signing this object:

@yoelpc4
yoelpc4 / sql-debug.php
Created September 27, 2020 20:52
Laravel SQL Debug
\DB::listen(function (\Illuminate\Database\Events\QueryExecuted $query) {
$sql = $query->sql;
$bindings = implode(', ', $query->bindings);
$time = $query->time;
\Log::info("\nSQL: {$sql}\nBindings: {$bindings}\nTime: {$time}\n\n");
});
@yoelpc4
yoelpc4 / Procfile
Last active November 25, 2021 14:48
Laravel Heroku Configuration
web: vendor/bin/heroku-php-nginx -C nginx.conf public/
supervisor: supervisord -c supervisor.conf -n
@yoelpc4
yoelpc4 / database.php
Last active April 5, 2021 10:32
Laravel Query Builder Cursor Method with MySQL Connection solution (based on https://github.com/laravel/framework/issues/14919)
'mysql_unbuffered' => [
'driver' => 'mysql',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',