Skip to content

Instantly share code, notes, and snippets.

@graninas
graninas / haskeller_competency_matrix.md
Last active January 13, 2025 22:22
Haskeller competency matrix
echo "export APP_DB_HOST=$(curl http://169.254.169.254/latest/meta-data/local-ipv4)" >> ~/.bashrc
echo "export APP_DB_USER=nodeapp" >> ~/.bashrc
echo "export APP_DB_PASSWORD=student12" >> ~/.bashrc
echo "export APP_DB_NAME=STUDENTS" >> ~/.bashrc
echo "export APP_PORT=80" >> ~/.bashrc
@bradtraversy
bradtraversy / mysql_cheat_sheet.md
Last active January 13, 2025 22:21
MySQL Cheat Sheet

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@rjeschke
rjeschke / NeetJavaSound.java
Created September 11, 2011 19:26
Low latency javax.sound.sampled API
package streaming;
import java.util.concurrent.Semaphore;
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.DataLine;
import javax.sound.sampled.Line;
import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.Mixer;
@sergiodxa
sergiodxa / crud.ts
Last active January 13, 2025 22:15
A crud helper for RRv7 routes.ts file
import { camelize, pluralize, singularize } from "inflected";
// e.g. crud("users")
function crud(name: string) {
let plural = pluralize(name);
let camelCase = camelize(singularize(name), false);
return route(plural, `./views/${plural}/layout.tsx`, [
index(`./views/${plural}/index.tsx`),
route("new", `./views/${plural}/new.tsx`),
@WomB0ComB0
WomB0ComB0 / reusable-providers.tsx
Created January 10, 2025 00:06
A reusable providers component that almost eliminates the need for context API
'use client';
import type { JSXElementConstructor, ReactNode } from 'react';
type InferProps<T> = T extends JSXElementConstructor<infer P> ? P : never;
type ProviderWithProps<T extends JSXElementConstructor<unknown>> = [
T,
Omit<InferProps<T>, 'children'>
];
@bzvyagintsev
bzvyagintsev / README.md
Last active January 13, 2025 22:15
Шаблон README.md

Название проекта

Добавьте краткое описание проекта, опишите какую задачу он решает. 1-3 предложения будет достаточно. Добавьте бейджи для важных статусов проекта: статус разработки (в разработке, на поддержке и т.д.), статус билда, процент покрытия тестами и тд.

Содержание

@Maharshi-Pandya
Maharshi-Pandya / contemplative-llms.txt
Last active January 13, 2025 22:14
"Contemplative reasoning" response style for LLMs like Claude and GPT-4o
You are an assistant that engages in extremely thorough, self-questioning reasoning. Your approach mirrors human stream-of-consciousness thinking, characterized by continuous exploration, self-doubt, and iterative analysis.
## Core Principles
1. EXPLORATION OVER CONCLUSION
- Never rush to conclusions
- Keep exploring until a solution emerges naturally from the evidence
- If uncertain, continue reasoning indefinitely
- Question every assumption and inference
@marcotrosi
marcotrosi / printTable.lua
Created May 25, 2015 14:39
Lua - printTable - print tables on stdout or write into files
--[[
A simple function to print tables or to write tables into files.
Great for debugging but also for data storage.
When writing into files the 'return' keyword will be added automatically,
so the tables can be loaded with 'dofile()' into a variable.
The basic datatypes table, string, number, boolean and nil are supported.
The tables can be nested and have number and string indices.
This function has no protection when writing files without proper permissions and
when datatypes other then the supported ones are used.
--]]
@bartvanandel
bartvanandel / README.md
Created October 3, 2022 11:56
Font download script, useful for using fonts as binary dependencies in your React Native app.

Introduction

We were facing an issue where we need a font to be present at build time for a React Native app. This font is essentially a binary dependency of our app, which we'd rather not add to our git repo (in general, this is not the best practice). There exist packages that can provide certain fonts, however these were either too unorganized for our taste, or didn't work with React-Native / Expo. So, we searched for a solution to just download the fonts at npm install time.

Solution