Skip to content

Instantly share code, notes, and snippets.

View tralves's full-sized avatar

Tiago Alves tralves

View GitHub Profile
<a href="irccom://com.irc.ircclient/register/confirm?a=tiagotest3&c=eEQ78B765">TEST LINK</a>
{
"windowTitle": "IRC.com - TEST",
"startupOptions.server": "irc.com"
}
[
{
"title": "Special Tagliatele al Pomodoro",
"likes": 8093,
"duration": "1:15",
"liked": true
},
{
"title": "Special Ravioli Nero di Sepia al Pomodoro",
"likes": 10435,
[
{
"id": 1,
"name": {
"first": "Alfreda",
"last": "Ferreira"
},
"location": {
"street": "4127 Rua Mato Grosso ",
"city": "Bagé",
@tralves
tralves / get_indexdb_sizes.js
Last active March 9, 2024 13:34
Calculate sizes of all IndexDB database and tables
var getTableSize = function(db, dbName){
return new Promise((resolve,reject) => {
if (db == null) {
return reject();
}
var size = 0;
db = event.target.result;
var transaction = db.transaction([dbName])
.objectStore(dbName)
.openCursor();
@tralves
tralves / TestCase.php
Created July 7, 2016 22:10
Laravel Storage mock test helper
<?php
use Illuminate\Support\Facades\Config;
class TestCase extends Laravel\Lumen\Testing\TestCase
{
/**
* Create a mock of a Storage disk.
*
* Usage:
@tralves
tralves / ProfileApiTest.php
Last active June 26, 2023 02:32
Override the Authentication when using dingo/api, when testing the Api with PhpUnit.
<?php
use App\Entities\User;
class ProfileApiTest extends TestCase
{
/**
* @test
*
* Get user profile.
@tralves
tralves / OverrideModuleConfiguration.php
Last active October 31, 2018 17:50
Laravel 5 middleware that overrides pingpong-labs/modules configurations over the app's Config.
<?php
namespace App\Http\Middleware;
/**
* When using pingpong-labs/modules, you may want to override app config when the request is made
* in the context of a module.
*
* This middleware will do that. For example, if the module/MyModule/Config/config.php has the code:
*