Skip to content

Instantly share code, notes, and snippets.

@matheusmacedoap
matheusmacedoap / routes.ts
Created November 23, 2024 23:57
Quasar Automatic Routes
import { RouteRecordRaw } from 'vue-router';
const layoutsImport = import.meta.glob('layouts/**/*.vue');
const pagesImport = import.meta.glob('pages/**/*.vue');
const pageRegex = /\.\/pages\/(.*)\.vue$/;
const layoutRegex = /\.\/layouts\/(.*)\.vue$/;
const routes: RouteRecordRaw[] = [
{
<Page
x:Class="MediaDial.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<StackPanel Padding="50">
@vjt
vjt / copy-from-time-machine.sh
Last active January 5, 2025 07:29
Copy data from a Time Machine volume mounted on a Linux box.
#!/bin/bash
#
# Copy data from a Time Machine volume mounted on a Linux box.
#
# Usage: copy-from-time-machine.sh <source> <target>
#
# source: the source directory inside a time machine backup
# target: the target directory in which to copy the reconstructed
# directory trees. Created if it does not exists.
#
@bedros-p
bedros-p / patcherooni.js
Created January 5, 2025 00:27
AI Studio patch to actually get the features users want
// This code structure is the function that provides a stable "reference" so that it gets the proper variable
const regex = /function\(\){var a=new _\...,b=new ..;return _\.(..)\(a,..,1,b\)}/gm;
// Reference to the null checker function used in serialization (and many other things [will filter later])
let nullchecker = ""
let nullcheckerWrapper = Object.keys(default_MakerSuite).find(
(makersuite_key) => {
const key = default_MakerSuite[makersuite_key]
if (typeof key != "function") return false
const sample_obj = {} // Was using for .bind() when testing injecting directly into the store.
// Might reuse later, but I can do things perfectly fine without access to the angular store so it was just unnecessary code
@0xdevalias
0xdevalias / working-around-flstudio-trial-limitations.md
Last active January 5, 2025 07:27
Some notes on working around limitations imposed by FLStudio's trial mode

Working Around FLStudio Trial Limitations

Some notes on working around limitations imposed by FLStudio's trial mode

Table of Contents

20210814 劉仲敬訪談第152集

注:本文2.51萬字,下次更新在8月19日。

主持人:剿匪學院

發布時間:2021年8月14日

@viridia
viridia / asset-migration.md
Last active January 5, 2025 07:18
Migrating to Bevy Assets V2

Migrating to Bevy Assets V2

Migrating a custom asset loader

Existing asset loaders will need a few small changes to get them to work with Bevy Assets V2.

First, you'll need to add the asset type as an associated type of the loader. This type is called Asset and represents the type of the "default asset" produced by the loader.

You'll also need to add a Settings type which represents options that can be passed to the loader when you request an asset. If your asset has no settings, then you can just set it to the unit type.

@RubenKelevra
RubenKelevra / fast_firefox.md
Last active January 5, 2025 07:17
Make Firefox fast again
@fatbobman
fatbobman / adaptiveSheet.swift
Created October 22, 2022 00:53
Adaptive Height Sheet
import SwiftUI
struct ContentView: View {
@State var show = false
var body: some View {
VStack {
Button("Pop Sheet") { show.toggle() }
}
.adaptiveSheet(isPresent: $show) { SheetView() }
}
@dsevero
dsevero / gumbel-softmax-trick.py
Last active January 5, 2025 07:16
Gumbel-Softmax Trick
# We can produce samples from an un-normalized distribution by adding
# iid Gumbel noise together with the argmax operator; which is denoted as the Gumbel-Max Trick.
# However, argmax doesn't produce meaningful gradient signals, so we replace argmax
# by softmax, with a temperature parameter (Gumbel-Softmax Trick).
#
# I didn't invent any of this, all credit goes to the following papers:
# - https://arxiv.org/abs/1611.00712
# - https://arxiv.org/abs/1611.01144
import numpy as np