This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Array Looping | |
*/ | |
const arr = ['foo']; | |
// A for...in loop will return the key... | |
// @see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in | |
for (const key in arr) { | |
console.log(key); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@php | |
$attr3 = 'baz'; | |
$attr4 = 99_999; | |
$attr5 = new stdClass; | |
$attrWtf = 'wtf'; | |
@endphp | |
<x-my-component | |
attr1="foo" {{-- Component receives string --}} | |
attr2="{{ 'bar' }}" {{-- Component receives string --}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// @see: https://docs.pydantic.dev/latest/concepts/pydantic_settings/#usage | |
final readonly class DatabaseConfig | |
{ | |
#[Concat( | |
#[Env('DB_HOST')], | |
#[Str('://')], | |
#[Env('DB_USER')], | |
#[Str('@')], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Contextual attributes were implementated by @innocenzi and @ollieread: | |
- https://github.com/laravel/framework/pull/51934 | |
- https://github.com/laravel/framework/pull/52428 | |
I added contextual attributes for the core drivers: | |
- https://github.com/laravel/framework/pull/52265 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The in-game camera speed when using a controller is really slow. | |
The issue appears to be caused by Steam Input: | |
Steam > Settings > Controller > Disable Enable Steam Input for Switch Pro controllers | |
You'll know when the change has worked because the camera speed will be a lot faster, and also controller button icons in the user interface will be grey/generic rather than Xbox coloured. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Most browsers support "display: none;" on select options to hide them. --> | |
<!-- However, Safari doesn't support this, and will still display the option. --> | |
<!-- The solution is to "display: none;" and disable the option. --> | |
<!-- The option will be hidden in most browsers, but still disabled in Safari. --> | |
<select> | |
<option></option> | |
<option value="foo">Foo</option> | |
<option value="bar">Bar</option> | |
<option value="baz">Baz</option> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log( | |
new Intl.DateTimeFormat('en-GB', { hour: 'numeric', minute: 'numeric', second: 'numeric' }) | |
.formatToParts(new Date) | |
.map((part) => part.value) | |
.join('') | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Export bookmarks, open HTML, run this: | |
const links = []; | |
document.querySelectorAll('body > dt:nth-of-type(4) a').forEach((a) => { | |
links.push(a.getAttribute('href')); | |
}); | |
links.join("\n"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Inspired by Twitter Unfollow All: https://gist.github.com/ziadoz/caa882e75c11be9e8064e570ffec1f5f | |
(() => { | |
const $bookmarkButtons = 'button.status__action-bar__button.bookmark-icon'; | |
const retry = { | |
count: 0, | |
limit: 3, | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# @link: https://github.com/tj/git-extras | |
# Install | |
brew install git-extras | |
# Usage | |
git-obliterate secrets.json |
NewerOlder