Skip to content

Instantly share code, notes, and snippets.

View believer's full-sized avatar
🍪
Omnomnom

Rickard Natt och Dag believer

🍪
Omnomnom
View GitHub Profile
@believer
believer / global.css
Last active October 27, 2023 12:24
Defining color tokens in Nativewind 4
/* Default Tailwind styles */
@tailwind base;
@tailwind components;
@tailwind utilities;
/* Light mode */
:root {
--colors-on-container: #353531;
}
const step = 100
const wait = 1000
const data = Array.from({ length: 69000 }, (_, i) => ({
id: i,
}))
const getData = async ({ id }) => Promise.resolve({ id, data: `data-${id}` })
const newData = []
const run = async (step) => {
@believer
believer / main.rs
Last active March 21, 2023 08:06
Parse Fluent files to TypeScript definitions
use anyhow::{anyhow, Result};
use std::fs;
fn main() -> Result<()> {
let args: Vec<String> = std::env::args().collect();
if args.len() <= 1 {
return Err(anyhow!("No file specified"));
}
@believer
believer / raycast-jira-to-tana.mjs
Last active February 28, 2024 09:39
Script for Raycast that takes a Jira link, fetches information from Jira's REST API, and converts it to Tana's paste format
#!/usr/bin/env node
// Required parameters:
// @raycast.schemaVersion 1
// @raycast.title Jira fetcher
// @raycast.mode silent
// Optional parameters:
// @raycast.icon 🤖
// @raycast.argument1 { "type": "text", "placeholder": "Jira URL" }
@believer
believer / input.scss
Created September 28, 2022 08:17
Generated by SassMeister.com.
// Defined in asset library
$color-data-blue: #5d8aff;
$color-data-purple: #a858ff;
// Map colors
$colors: (
blue: $color-data-blue,
purple: $color-data-purple,
// and so on...
);
@believer
believer / machine.js
Last active May 4, 2021 07:09
Generated by XState Viz: https://xstate.js.org/viz
const fetchSeller = () => Promise.resolve({ streetAddress: 'Test street' })
const sellerInformationValid = (ctx, event) => !!ctx.seller.streetAddress
const validId = () => false
const fetchMachine = Machine(
{
id: 'kp-form',
initial: 'seller',
@believer
believer / kitty.conf
Created October 7, 2020 07:46
Kitty color setup
#: The 16 terminal colors. There are 8 basic colors, each color has a
#: dull and bright version. You can also set the remaining colors from
#: the 256 color table as color16 to color255.
color0 #051626
color8 #334452
#: black
color1 #ef5350
@believer
believer / machine.js
Created March 23, 2020 19:28
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@believer
believer / playlist.js
Created February 23, 2020 16:53
Get playlist as csv from soundtrack.net
Array.apply(
null,
document.querySelectorAll('.cbox_table tbody tr:not(:last-child)')
)
.map((node, i) => {
var title = node.querySelector('td:nth-child(2)').innerText.trim()
var playtime = node.querySelector('td:nth-child(3)').innerText.trim()
return `${i + 1};${title};${playtime}`
})
@believer
believer / training.sql
Last active May 24, 2019 14:31
Mock setup for CrossFit workout database
-- DOWN
DROP SCHEMA public CASCADE;
-- UP
CREATE SCHEMA public;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO public;
-- Equipment enum