Skip to content

Instantly share code, notes, and snippets.

View lotharthesavior's full-sized avatar

Sávio Resende lotharthesavior

View GitHub Profile
@jlmaners
jlmaners / MockSocialite.php
Last active January 1, 2024 21:15
Mocking Socialite
<?php
$mockSocialite = \Mockery::mock('Laravel\Socialite\Contracts\Factory');
$this->app['Laravel\Socialite\Contracts\Factory'] = $mockSocialite;
$abstractUser = Mockery::mock('Laravel\Socialite\Two\User');
$abstractUser
->shouldReceive('getId')
->andReturn(rand())
->shouldReceive('getName')
@matthewblewitt
matthewblewitt / style.css
Created September 5, 2019 07:30
CSS Outline
* { background-color: rgba(255,0,0,.2); }
* * { background-color: rgba(0,255,0,.2); }
* * * { background-color: rgba(0,0,255,.2); }
* * * * { background-color: rgba(255,0,255,.2); }
* * * * * { background-color: rgba(0,255,255,.2); }
* * * * * * { background-color: rgba(255,255,0,.2); }
* * * * * * * { background-color: rgba(255,0,0,.2); }
* * * * * * * * { background-color: rgba(0,255,0,.2); }
* * * * * * * * * { background-color: rgba(0,0,255,.2); }
@monsterooo
monsterooo / .js
Last active December 4, 2024 12:22
monaco-syntax-php
// https://microsoft.github.io/monaco-editor/playground.html#extending-language-services-custom-languages
// Register a new language
monaco.languages.register({ id: 'mySpecialLanguage' });
// Register a tokens provider for the language
monaco.languages.setMonarchTokensProvider('mySpecialLanguage', {
tokenizer: {
root: [
// [/<\?((php)|=)?/, { token: '@rematch', switchTo: '@phpInSimpleState.root' }],
{ include: 'phpRoot' },
@johanjanssens
johanjanssens / openmetrics.php
Last active June 19, 2022 13:50
Openswoole - getMetrics()
<?php
/**
* Extracted from https://github.com/openswoole/swoole-src/blob/f191c0b0a98e9b97f5c81d4877f450c863e6c36d/ext-src/php_swoole_library.h#L6999
*
* Changes:
*
* - Added 'service' label
* - Added additional label support
*