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
import fs from 'node:fs/promises' | |
export function sql(url) { | |
return { | |
name: 'vite-plugin-sql', | |
// expose an import called 'sql:runtime' | |
resolveId(id) { | |
if (id.startsWith('sql:runtime')) { | |
return id |
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 const chaosTestStrings = (): void => { | |
const textNodes = getAllTextNodes(document.body); | |
for (const node of textNodes) { | |
const textNodeLength = node.textContent ? node.textContent.length : 0; | |
if (node.textContent === null) { | |
return; | |
} | |
if (node.parentElement instanceof Element) { | |
if (node.parentElement.dataset.originalText === undefined) { |
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
import { initTRPC } from '@trpc/server'; | |
import { resolveHTTPResponse } from '@trpc/server/http'; | |
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'; | |
const t = initTRPC.create(); | |
export const appRouter = t.router({ | |
hello: t.procedure.query(() => { | |
return { message: 'World' }; | |
}), |
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
import { defineConfig } from 'vite'; | |
import laravel from 'laravel-vite-plugin'; | |
import fs from 'fs'; | |
import { resolve } from 'path'; | |
import { homedir } from 'os'; | |
let host = 'sendstack.test'; | |
let homeDir = homedir(); | |
let serverConfig = {}; |
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
import path from 'path' | |
import vue from '@vitejs/plugin-vue' | |
import icons from 'vite-plugin-svg-icons' | |
import inspect from 'vite-plugin-inspect' | |
import tailwindcss from 'tailwindcss' | |
import autoprefixer from 'autoprefixer' | |
import createDebugger from 'debug' | |
import { defineConfig } from 'laravel-vite' | |
export default defineConfig() |
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 {{ factoryNamespace }}; | |
use Illuminate\Database\Eloquent\Factories\Factory; | |
use {{ namespacedModel }}; | |
/** | |
* @method {{ model }}|\Illuminate\Support\Collection<{{ model }}> create($attributes = [], ?Model $parent = null) | |
* @method \Illuminate\Support\Collection<{{ model }}> createMany(iterable $records) |
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
# run this once, then reload, and then skip this | |
!apt install rustc | |
!gdown --id 1PULtTc-2e9z4bswh_SQqL5oy_4JpfV7c | |
!chmod +x evcxr_jupyter | |
!./evcxr_jupyter --install | |
// install dependency | |
:dep cmd_lib | |
use cmd_lib::run_cmd as sh; |
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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
// Moves Camera similar to how camera is moved in the Unity view port. Drop the scrip on the game object which has the camera and you wish to move. | |
public class SmoothGameCameraMovement : MonoBehaviour | |
{ | |
public float lateralSpeed = 0.0015f; |
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
git checkout --orphan new-framework | |
# completely rewrite your application in new framework | |
git merge --strategy=ours --allow-unrelated-histories master | |
git commit-tree -p HEAD^2 -p HEAD^1 -m "Merge branch 'new-framework'" "HEAD^{tree}" | |
git reset --hard $OUTPUT_FROM_PREVIOUS_COMMAND | |
git checkout master | |
git merge --ff-only new-framework |
NewerOlder