Skip to content

Instantly share code, notes, and snippets.

@tommie
tommie / button.css
Last active February 25, 2025 10:28
Raised selection button https://jsfiddle.net/sehdxjr8/3/
/* Inspired by https://dribbble.com/shots/11333956-Smart-Home-App */
body {
background-color: #eee;
}
div {
display: inline-block;
padding: 8px;
margin: 2rem;
border-radius: 8px;
@tommie
tommie / pinialayers.ts
Created October 7, 2024 13:44
Pinia Nuxt module fix for layers
import { createResolver, defineNuxtModule, installModule } from '@nuxt/kit';
import type { ModuleOptions } from '@pinia/nuxt';
// Works around layers in Pinia.
//
// See https://github.com/vuejs/pinia/pull/2757.
export default defineNuxtModule<ModuleOptions>({
meta: {
name: 'pinialayers',
configKey: 'pinia',
@tommie
tommie / gdb bt
Last active September 25, 2024 07:58
cups-browsed 2.0.0 (Ubuntu 24.04.1) 100% CPU after suspend/resume
#0 0x0000710989bfdf92 in httpGets () at /lib/x86_64-linux-gnu/libcups.so.2
#1 0x0000710989bff416 in _httpUpdate () at /lib/x86_64-linux-gnu/libcups.so.2
#2 0x0000710989bff78b in httpUpdate () at /lib/x86_64-linux-gnu/libcups.so.2
#3 0x0000710989c175de in cupsSendRequest () at /lib/x86_64-linux-gnu/libcups.so.2
#4 0x0000710989c179d5 in cupsDoIORequest () at /lib/x86_64-linux-gnu/libcups.so.2
#5 0x0000710989d44792 in cfGetPrinterAttributes5 (http_printer=http_printer@entry=0x5d886f0068e0, raw_uri=raw_uri@entry=0x7fff54da0ad0 "ipp://localhost/printers/br_mfc_j6920dw", pattrs=pattrs@entry=0x5d886d444140 <pattrs>, pattrs_size=pattrs_size@entry=4, req_attrs=<optimized out>, req_attrs@entry=0x5d886d444140 <pattrs>, req_attrs_size=<optimized out>, req_attrs_size@entry=4, debug=1, driverless_info=0x0, is_fax=0) at cupsfilters/ipp.c:361
#6 0x0000710989d44e4a in cfGetPrinterAttributes3 (http_printer=http_printer@entry=0x5d886f0068e0, raw_uri=raw_uri@entry=0x7fff54da0ad0 "ipp://localhost/printers/br_mfc_j6920dw",
import * as THREE from "three";
function isLineBasicMaterial(mat: THREE.Material & { isLineBasicMaterial?: boolean }): mat is THREE.LineBasicMaterial {
return Boolean(mat.isLineBasicMaterial);
}
function isOrthographicCamera(camera: THREE.Camera & { isOrthographicCamera?: boolean }): camera is THREE.OrthographicCamera {
return Boolean(camera.isOrthographicCamera);
}
(module
(func $func132 (param i32 i32 i32 i32))
(func $main
i32.const 0
i32.const 0
i32.const 0
i32.const 0
call $func132)
(module
(func $func15 (result i32)
call $func130
i32.const 0
drop
i32.const 0
drop
i32.const 0)
(func $func63
(module
(func $main
loop
loop
loop
loop
loop
loop
loop
loop
@tommie
tommie / Dockerfile
Created May 17, 2024 11:53
protobuf-javascript Dockerfile for Alpine Linux.
# https://github.com/protocolbuffers/protobuf-javascript/issues/105
# https://github.com/protocolbuffers/protobuf/pull/9874
FROM alpine
RUN apk --no-cache add gcompat
ARG protoc_js_ver=3.21.2
RUN cd /usr/local &&\
wget -Oprotojs.tar.gz "https://github.com/protocolbuffers/protobuf-javascript/releases/download/v$protoc_js_ver/protobuf-javascript-$protoc_js_ver-linux-$(uname -m).tar.gz" &&\
@tommie
tommie / emulator
Last active May 7, 2024 07:34
Wrapper script to add command line options to the AVD emulator.
#! /bin/bash
#
# Wrapper script to add command line options to the AVD emulator.
#
# avdmanager should support the studio.emu.params environment variable, but it doesn't handle commas well.
#
# ## Installation
#
# 1. Find your AVD home directory. It should have an `emulator` subdirectory.
# 2. Move the `emulator/emulator` file to `emulator/emulator-orig`.
@tommie
tommie / android app src main AndroidManifest.xml
Last active May 6, 2024 10:02
Example usb_serial intent configuration
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:label="example"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"