Skip to content

Instantly share code, notes, and snippets.

View ibrunotome's full-sized avatar
👨‍💻
Up and running...

Bruno Tomé ibrunotome

👨‍💻
Up and running...
View GitHub Profile
@ciiqr
ciiqr / zod-optional-null.ts
Last active May 13, 2024 11:12
zod optional/nullable/nullish differences
// zod schema
z.object({
// valid if string or:
optional: z.string().optional(), // field not provided, or explicitly `undefined`
nullable: z.string().nullable(), // field explicitly `null`
nullish: z.string().nullish(), // field not provided, explicitly `null`, or explicitly `undefined`
});
// type
{
export default defineConfig({
plugins: [
laravel(['resources/js/app.js']),
{
name: 'ziggy',
enforce: 'post',
handleHotUpdate({ server, file }) {
if (file.includes('/routes/') && file.endsWith('.php')) {
exec('php artisan ziggy:generate', (error, stdout) => error === null && console.log(` > Ziggy routes generated!`))
}
2gua.rainbow-brackets
adampalhazi.vscode-debug-arrow-function
alexcvzz.vscode-sqlite
alfnielsen.vsc-organize-imports
aliariff.auto-add-brackets
andys8.jest-snippets
antfu.iconify
antfu.vite
apollographql.vscode-apollo
arcticicestudio.nord-visual-studio-code
{
"git.enableSmartCommit": true,
"workbench.editor.decorations.colors": true,
"editor.minimap.enabled": false,
"editor.accessibilitySupport": "off",
"zenMode.hideLineNumbers": false,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"tailwindCSS.includeLanguages": {
"typescriptreact": "html",
"plaintext": "html",
@jschuur
jschuur / 01_upcoming_video.json
Last active December 23, 2022 01:52
YouTube API video states for videos before, during and after a premiere. Note the liveBroadcastContent and liveStreamingDetails fields.
{
"kind": "youtube#videoListResponse",
"etag": "\"Dn5xIderbhAnUk5TAW0qkFFir0M/PmyFcfudY-pRuyR1eE-yWB5uLE4\"",
"pageInfo": {
"totalResults": 1,
"resultsPerPage": 1
},
"items": [
{
"kind": "youtube#video",
[alias]
ci = commit
co = checkout
cm = checkout master
cb = checkout -b
st = status -sb
sf = show --name-only
lg = log --pretty=format:'%Cred%h%Creset %C(bold)%cr%Creset %Cgreen<%an>%Creset %s' --max-count=30
incoming = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' ..@{u})
outgoing = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' @{u}..)
@laravel-shift
laravel-shift / .php-cs-fixer.php
Last active April 9, 2024 14:08
PHP CS Fixer - Laravel Coding Style Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
@emersonbroga
emersonbroga / README.md
Last active November 25, 2018 14:14
Bitcoin value with Javascript

Bitcoin Price

How to run

npm install --save request
node bitcoin-price.js
<?php
namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
use Illuminate\Support\Facades\DB;
/**
* Class Kernel
* @package App\Http
@nathanborror
nathanborror / index.js
Last active November 27, 2018 21:01
Slack webhook Cloud Functions for Google Cloud Container Builder
const IncomingWebhook = require("@slack/client").IncomingWebhook
const SLACK_WEBHOOK_URL = "SLACK_WEBHOOK_URL"
const webhook = new IncomingWebhook(SLACK_WEBHOOK_URL)
// subscribe is the main function called by Cloud Functions.
module.exports.slackSubscribe = (event, callback) => {
const build = eventToBuild(event.data.data)
// Skip if the current status is not in the status list.