Skip to content

Instantly share code, notes, and snippets.

View thecrypticace's full-sized avatar

Jordan Pittman thecrypticace

View GitHub Profile
@thecrypticace
thecrypticace / index.html
Created May 19, 2022 23:28
Square Root in CSS
<meta charset="utf-8">
<style>
.square-root {
--n: 0;
--guess-0: 1;
--guess-1: calc(0.5 * calc(var(--guess-0) + calc(var(--n) / var(--guess-0))));
--guess-2: calc(0.5 * calc(var(--guess-1) + calc(var(--n) / var(--guess-1))));
--guess-3: calc(0.5 * calc(var(--guess-2) + calc(var(--n) / var(--guess-2))));
--guess-4: calc(0.5 * calc(var(--guess-3) + calc(var(--n) / var(--guess-3))));
@thecrypticace
thecrypticace / details.md
Last active July 5, 2023 14:29
My Dream Display
  • Vesa-mountable
  • Ultrawide 21:9 34" / 32:9 49"
  • 3440x1440 @2x / 5120x1440 @2x (so: 6880x2880 / 10240x2880)
  • 1800R
  • Retina
  • OLED
  • IPS
  • 10-bit color
  • Continuous 1600+ nits HDR / 600 SDR over whole display for all content with no dimming compensation
  • 165+ Hz
[ValheimPlus]
; Change false to true to enable this section. https://valheim.plus/documentation/list#ValheimPlus
enabled = true
; Display the Valheim Plus logo in the main menu
mainMenuLogo = true
; Display the advertisement of our server hosting partner on the server browser menu
serverBrowserAdvertisement = true
use std::{path::PathBuf, fs::File, env, collections::HashMap, rc::Rc, cell::RefCell, fmt::Display};
use itertools::Itertools;
use fastanvil::*;
use rayon::prelude::{ParallelIterator, IntoParallelIterator};
#[derive(Clone, Eq, PartialEq, Debug)]
struct BlockDescriptor {
name: String,
x: i64,
package rewriting
import (
"exprparser/expr"
)
// eliminateSupersets Eliminates supersets from the expression tree
//
// Given the expression:
// (A || B) && (A || B || C) && (A || C)
@thecrypticace
thecrypticace / tsconfig.json
Last active February 14, 2022 12:37
Laravel Mix config for Vue 3 compat build
// If you're using typescript or ts-check you can alias the composition api package as well:
{
"compilerOptions": {
// … other stuff omitted for brevity …
// Ensure your base url is set
"baseUrl": ".",
"paths": {
// Add composition API to your compiler options and alias it to the vue 3 install
// The path is relative to `baseUrl` above
async function renderToString(vnodes) {
const el = document.createElement("div")
return new Promise(resolve => {
createApp({
setup() {
onMounted(() => resolve(el.innerHTML)
return () => vnodes
},
}).mount(el)
})
import { createApp, configureCompat } from "vue"
configureCompat({ MODE: 3 })
const app = createApp({
setup() {
return {
// stuff
}
}
@thecrypticace
thecrypticace / webpack.mix.js
Created September 24, 2020 13:02
Mix + custom API for separate builds
const mix = require("laravel-mix")
mix.site = (id, callback) => {
if (!process.env.SITE || process.env.SITE === id) {
return callback()
}
};
mix.site('admin', () => {
mix.js("resources/js/admin/app.js", "public/js/admin.js")
#!/usr/bin/env swift
import Foundation
let df = DateFormatter()
df.locale = Locale(identifier: "en_US")
df.timeZone = TimeZone(identifier: "Antarctica/Casey")
df.setLocalizedDateFormatFromTemplate("zzzz")
print("\(String(describing: df.timeZone))")
print(df.string(from: Date()))