Skip to content

Instantly share code, notes, and snippets.

@scottcreynolds
scottcreynolds / logic.rb
Created February 11, 2025 20:31
Logic Bullshit
# in logic notation
# a -> b is "if a then b"
# so in programming:
a = false
b = true
if a
puts "a true"
@HugsLibRecordKeeper
HugsLibRecordKeeper / output_log.txt
Created February 11, 2025 20:31
Rimworld output log published using HugsLib
Log uploaded on Tuesday, February 11, 2025, 2:31:23 PM
Loaded mods:
Harmony(brrainz.harmony)[mv:2.3.1.0]: 0Harmony(2.3.3), HarmonyMod(2.3.1)
Core(Ludeon.RimWorld): (no assemblies)
Royalty(Ludeon.RimWorld.Royalty): (no assemblies)
Ideology(Ludeon.RimWorld.Ideology): (no assemblies)
Biotech(Ludeon.RimWorld.Biotech): (no assemblies)
Camera+(brrainz.cameraplus)[mv:3.2.0.0]: CameraPlus(3.2.0), CrossPromotion(1.1.2)
EdB Prepare Carefully(EdB.PrepareCarefully)[mv:1.5.12]: EdBPrepareCarefully(av:1.1.1,fv:1.5.12)
RimSaves(aRandomKiwi.RimSaves): RimSaves(2024.0.1.20)
@luizbills
luizbills / code.js
Created February 11, 2025 20:31
Simple shmup demo in Litecanvas
let scale = 2
litecanvas({
width: 640,
height: 480,
autoscale: false,
// fps: 30
})
// Art Code: 8x8/# # 6 6 6 6 # # # # 6 6 6 6 # # # # 6 6 6 6 # # 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 # # 6 6 6 6 6 6 # # 6 6 6

O(log n): Logarithmic Time

Before we can get into this one, we need to cover one fundamental question:

What is a Logarithm?

A logarithm answers a very basic question:

"To what power must we raise a certain number (called the base) to get another number?"

In mathematical terms, if we have:

@peterc
peterc / CONVENTIONS.md
Last active February 11, 2025 22:02
CONVENTIONS.md file for AI Rails 8 development
  • You MUST NOT try and generate a Rails app from scratch on your own by generating each file. For a NEW app you MUST use rails new first to generate all of the boilerplate files necessary.
  • Create an app in the current directory with rails new .
  • Use Tailwind CSS for styling. Use --css tailwind as an option on the rails new call to do this automatically.
  • Use Ruby 3.2+ and Rails 8.0+ practices.
  • Use the default Minitest approach for testing, do not use RSpec.
  • Default to using SQLite in development. rails new will do this automatically but take care if you write any custom SQL that it is SQLite compatible.
  • An app can be built with a devcontainer such as rails new myapp --devcontainer but only do this if requested directly.
  • Rails apps have a lot of directories to consider, such as app, config, db, etc.
  • Adhere to MVC conventions: singular model names (e.g., Product) map to plural tables (products); controllers are plural.
  • Guard against incapable browsers accessing controllers with `allo
@Niffler
Niffler / fish_greeting.fish
Created February 11, 2025 20:30
fish shell function that displays current uptime as welcome message
function fish_greeting
echo (set_color red)(string match -r '\d\d:\d\d:\d\d' (uptime))(set_color normal)'; booted at' (set_color yellow)(string match -r '\d\d:\d\d:\d\d' (uptime -s))(set_color normal)'; up' (set_color green)(string replace -r 'up ' '' (uptime -p))
end
Pipeline still running ...
PipelineRun is still running: Tasks Completed: 11 (Failed: 1, Cancelled 0), Incomplete: 1, Skipped: 42
[get-pr-number : parse-pr-url] + echo -n 5939
[get-pr-number : parse-pr-url] + tee /tekton/results/git_pr_number
[get-pr-number : parse-pr-url] 5939
[acquire-lease : create-lease] + calculate_duration_in_seconds 90m
[acquire-lease : create-lease] + '[' m == m ']'
[acquire-lease : create-lease] + TOTAL_DURATION_IN_SECONDS=5400
[acquire-lease : create-lease] + export TOTAL_DURATION_IN_SECONDS
@rpede
rpede / main.dart
Created February 11, 2025 20:30
Simplified Flutter counter demo app
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
@choco-bot
choco-bot / FilesSnapshot.xml
Created February 11, 2025 20:30
snappy-driver-installer-origin v1.0.558 - Passed - Package Tests Results
<?xml version="1.0" encoding="utf-8"?>
<fileSnapshot xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<files>
<file path="C:\ProgramData\chocolatey\lib\snappy-driver-installer-origin\snappy-driver-installer-origin.nupkg" checksum="A011C17FE08D4CB2246FEEFC3A43611C" />
<file path="C:\ProgramData\chocolatey\lib\snappy-driver-installer-origin\snappy-driver-installer-origin.nuspec" checksum="5AFFD2AE70A0BA857605A28751364943" />
</files>
</fileSnapshot>
@jchai002
jchai002 / poc.js
Created February 11, 2025 20:29
POC: register Builder Components using Object Format
// on registerBuilderComponents.js
export const gridOnlyComponents = {
BuilderCollection: {
component: dynamic(() => import('~/builder/components/BuilderCollection')),
config: BuilderCollectionConfig,
},
BuilderConstructorGrid: {
component: dynamic(() =>
import('~/builder/components/BuilderConstructorGrid')