Skip to content

Instantly share code, notes, and snippets.

View acidjazz's full-sized avatar
🎯
Focusing

kevin olson acidjazz

🎯
Focusing
View GitHub Profile
@acidjazz
acidjazz / error.txt
Created December 10, 2021 02:01
Ineffective mark-compacts - v16.13.1
[4/5] 🔗 Linking dependencies...
warning "eslint-config-oclif-typescript > eslint-config-xo-space@0.20.0" has incorrect peer dependency "eslint@^5.3.0".
warning "eslint-config-oclif-typescript > @typescript-eslint/parser@2.34.0" has incorrect peer dependency "eslint@^5.0.0 || ^6.0.0".
warning "eslint-config-oclif-typescript > @typescript-eslint/eslint-plugin@2.34.0" has incorrect peer dependency "eslint@^5.0.0 || ^6.0.0".
<--- Last few GCs --->
[13300:0x128008000] 54578 ms: Mark-sweep 4042.3 (4135.2) -> 4028.0 (4134.4) MB, 758.5 / 0.0 ms (average mu = 0.128, current mu = 0.054) allocation failure scavenge might not succeed
[13300:0x128008000] 55066 ms: Mark-sweep 4043.8 (4134.4) -> 4031.1 (4137.7) MB, 461.7 / 0.0 ms (average mu = 0.103, current mu = 0.053) allocation failure scavenge might not succeed
lottie (): void {
if (!process.browser || !window.lottie) return
const lottie = window.lottie
const container = this.$refs.darkMode as HTMLElement
this.darkMode = lottie.loadAnimation({
container,
renderer: 'svg',
path: '/json/darkMode.json',
loop: false,
autoplay: false,
<?
Schema::create('orders', function (Blueprint $table) {
$table->id();
$table->string('table')->nullable();
$table->foreignIdFor(Rst::class)->constrained();
$table->foreignIdFor(Loc::class)->constrained();
});
Schema::create('order_menu', function (Blueprint $table) {
static priceFromCartChoices (rst: Rst, menuId: number, cartChoices: CartChoices, quantity: number) {
const options = this.choicesCombined(rst, menuId).map(c => c.options).flat() as Options
const ids = cartChoices.map(c => c.options).flat()
const selects = options.filter(o => ids.includes(o.id) && o.price) as OptionsWithPrices
const extras = selects.reduce((a, b) => a + b.price, 0)
return (this.menuFromId(rst, menuId).price + extras) * quantity
}
@acidjazz
acidjazz / ImageUpload.vue
Created August 29, 2021 07:17
image upload
<template>
<div class="w-64 h-52 flex justify-center items-center border-2 border-gray-300 border-dashed rounded-md">
<div class="space-y-1 text-center">
<icon-images class="mx-auto w-12 h-12" />
<div class="flex text-sm text-gray-600">
<label for="file-upload" class="relative cursor-pointer bg-white rounded-md font-medium text-fuchsia-600 hover:text-indigo-500 focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-indigo-500">
<span>Upload an image</span>
<input
id="file-upload"
name="file-upload"
@acidjazz
acidjazz / ImageController.php
Created August 27, 2021 21:37
store a file to s3
<?
public function store(Request $request): Response|JsonResponse
{
$this
->option('file', 'required|file|max:10000000')
->option('type', 'nullable|in:' . Image::ABLES)
->option('id', 'nullable')
->verify();
/** @var UploadedFile $file */
@acidjazz
acidjazz / webhook.php
Created August 8, 2021 01:19
webhooks
<?
public function test()
{
if ($this->hook->type === 'discord') {
Http::post(
$this->hook->url,
[
'username' => 'fume',
'avatar_url' => 'https://fume.app/fume-light-full.png',
'embeds' => [
@acidjazz
acidjazz / IndefinteArticle.php
Last active July 28, 2021 21:45
Indefinte Articles in PHP
<?php
namespace App\Services;
class IndefiniteArticle
{
public static function a($text): string
{
return self::indefiniteArticleForm($text);
@acidjazz
acidjazz / gist:620f7520e6970488966adc0dad3397a1
Created July 23, 2021 10:30
typescript and mixins error
ERROR in client/pages/rst/_rst/menu/create.vue:54:16
TS2769: No overload matches this call.
Overload 1 of 2, '(options?: (object & ComponentOptions<Vue, DataDef<((this: Readonly<unknown> & Vue) => { label: string; state: PushButtonState; rst: Rst | undefined; }) & Omit<Record<string, any>, keyof VueConstructor<...>>, unknown, Vue>, { ...; }, unknown, RecordPropsDefinition<...>, unknown> & ThisType<...> & { ...; }) | undefined): ExtendedVue<...>', gave the following error.
Type '[{ getRst(): Promise<Rst>; crumbs(crumbs: BreadCrumbs): void; } & VueConstructor<Vue>]' is not assignable to type '(VueConstructor<Vue> | ComponentOptions<Vue, DefaultData<Vue>, DefaultMethods<Vue>, DefaultComputed, PropsDefinition<...>, DefaultProps>)[] & [...]'.
Type '[{ getRst(): Promise<Rst>; crumbs(crumbs: BreadCrumbs): void; } & VueConstructor<Vue>]' is not assignable to type '[Record<string, any>, Record<string, any>]'.
Source has 1 element(s) but target requires 2.
Overload 2 of 2, '(options?: (object & Co
@acidjazz
acidjazz / develop.yml
Created July 22, 2021 09:53
develop and master
on:
push:
branches:
- develop
jobs:
fume-develop:
name: Deploy with Fume
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1