Skip to content

Instantly share code, notes, and snippets.

View DCzajkowski's full-sized avatar

Dariusz Czajkowski DCzajkowski

View GitHub Profile
@DCzajkowski
DCzajkowski / userChrome.css
Last active December 21, 2021 19:08
My CSS modifications to the current state of Proton design for Firefox (v90.0b4)
/*
* Firefox 96.0
*/
/* Removes the padding between pinned and unpinned tabs */
#tabbrowser-tabs[haspinnedtabs]:not([positionpinnedtabs]) > #tabbrowser-arrowscrollbox > .tabbrowser-tab[first-visible-unpinned-tab] {
margin-inline-start: 0 !important;
}
/* Makes the speaker icon to always appear if the tab is playing (not only on hover) */
@DCzajkowski
DCzajkowski / Handler.php
Last active August 19, 2018 11:44
app/Exceptions/Handler.php
<?php
namespace App\Exceptions;
use Exception;
use Illuminate\Support\ViewErrorBag;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
class Handler extends ExceptionHandler
{
# Create a file in Plugins/
# You can run this via Sublime's console with: view.run_command("php_unit_test_method")
# You can bind it to ctrl+e as a regular command
import sublime
import sublime_plugin
class PhpUnitTestMethodCommand(sublime_plugin.TextCommand):
def run(self, edit):
line = self.view.substr(self.view.line(self.view.sel()[0]))
<snippet>
<content><![CDATA[
/** @test */
function ${1/\s/_/g}() {
${0:// ${1:type name of method with spaces}}
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>test</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<?php
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Notification;
use Illuminate\Auth\Notifications\ResetPassword;
// ...
Notification::assertSentTo($user, ResetPassword::class, function ($notification, $channels) use ($token) {
return Hash::check($notification->token, $token->token) === true;
<?php
namespace Tests\Feature\Auth;
use App\User;
use Tests\TestCase;
use Illuminate\Support\Facades\Notification;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
<?php
$response->assertCookie(Auth::guard()->getRecallerName(), vsprintf('%s|%s|%s', [
$user->id,
$user->getRememberToken(),
$user->password,
]));
<?php
$value = vsprintf('%s|%s|%s', [
$user->id,
$user->getRememberToken(),
$user->password,
]));
<?php
// ...
class LoginTest extends TestCase
{
// ...
public function test_remember_me_functionality()
{
<?php
// ...
class LoginTest extends TestCase
{
// ...
public function test_user_cannot_login_with_incorrect_password()
{