View ml.html
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
<html> | |
<script src="/basic/canvas.js"></script> | |
<script src="/basic/ml.js"></script> | |
<div style="border: 1px solid black; width: 100px; height: 100px;"> | |
<canvas width="200" height="200" id="points" style="position: absolute; width: 100px; height: 100px"></canvas> | |
<canvas width="200" height="200" id="line" style="position: absolute; width: 100px; height: 100px"></canvas> | |
</div> | |
<script> |
View alpine-turbo-adapter.html
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
<script data-turbo-eval="false"> | |
document.addEventListener('turbo:before-render', () => { | |
let permanents = document.querySelectorAll('[data-turbo-permanent]') | |
let undos = Array.from(permanents).map(el => { | |
el._x_ignore = true | |
return () => { | |
delete el._x_ignore | |
} |
View utils.js
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
function benchmark(times, callbacks) { | |
let result = {} | |
Object.entries(callbacks).forEach(([key, value]) => { | |
let thing = {} | |
let start = performance.now() | |
for (let index = 0; index < times; index++) { | |
value() | |
} |
View twitter_clone_tailwind2.html
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@tailwindcss/ui@latest/dist/tailwind-ui.min.css"> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> | |
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.x.x/dist/alpine.min.js" defer></script> |
View twitter_clone_markup.html
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="https://unpkg.com/tailwindcss@0.7.4/dist/tailwind.min.css"> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> | |
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.x.x/dist/alpine.min.js" defer></script> |
View karabiner_vim_mode.json
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
{ | |
"title": "Caleb's Vim Mode", | |
"author": "Caleb Porzio(calebporzio.com)", | |
"rules": [ | |
{ | |
"description": "Vim Mode [D as Trigger Key]", | |
"manipulators": [ | |
{ | |
"from": { | |
"key_code": "d", |
View caps_lock_to_command_escape.json
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
{ | |
"title": "Caps Lock To Command/Escape", | |
"author": "Caleb Porzio(calebporzio.com)", | |
"homepage": "https://gist.github.com/calebporzio/2d07cd0e3013e7eaf16f5a2ea4f594ae", | |
"import_url": "karabiner://karabiner/assets/complex_modifications/import?url=https://gist.githubusercontent.com/calebporzio/2d07cd0e3013e7eaf16f5a2ea4f594ae/raw/08c397b09fbaa5ec90cf161e5bca97bdb43e8c55/caps_lock_to_command_escape.json", | |
"rules": [ | |
{ | |
"description": "Caps Lock to Command/Escape", | |
"manipulators": [ | |
{ |
View artisan_db_open.php
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 | |
Artisan::command('db:open {connection?}', function ($connection = null) { | |
if (! file_exists('/Applications/TablePlus.app')) { | |
$this->warn('This command uses TablePlus, are you sure it\'s installed?'); | |
$this->line("Install here: https://tableplus.com/\n"); | |
} | |
$driver = $connection ?: config('database.default'); | |
$host = config("database.connections.{$driver}.host"); |
View LivewireLoginTest.php
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 | |
namespace Tests\Feature; | |
use App\User; | |
use Tests\TestCase; | |
use Livewire\Livewire; | |
use Illuminate\Support\Facades\Route; | |
use Illuminate\Foundation\Testing\RefreshDatabase; |
View RouteDirectives.php
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 | |
// Register these inside a service provider: | |
Blade::directive('route', function ($expression) { | |
return "<?php echo route({$expression}) ?>"; | |
}); | |
Blade::directive('routeIs', function ($expression) { | |
return "<?php if (request()->routeIs({$expression})) : ?>"; |
NewerOlder