Skip to content

Instantly share code, notes, and snippets.

@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

@tmonjalo
tmonjalo / list-fftabs.py
Created September 13, 2018 10:42
List all Firefox tabs with title and URL
#! /usr/bin/env python3
"""
List all Firefox tabs with title and URL
Supported input: json or jsonlz4 recovery files
Default output: title (URL)
Output format can be specified as argument
"""
@LukeberryPi
LukeberryPi / cv.tex
Created July 1, 2024 23:14
my cv NO INFO
\documentclass[a4paper,10pt]{article}
\usepackage[margin=0.5in,nofoot]{geometry}
\usepackage{fontawesome5}
\usepackage{hyperref}
\usepackage{titlesec}
\usepackage{xcolor}
\hypersetup{
colorlinks=true,
linkcolor=blue,
@naviocean
naviocean / git_large_file.md
Created September 14, 2020 07:36
Fixing the “GH001: Large files detected. You may want to try Git Large File Storage.”

Fixing the “GH001: Large files detected. You may want to try Git Large File Storage.”

I just migrated my repositories from BitBucket to GitHub but, suddenly, I received an interesting error when I tried to push a repo with some large files inside.

remote: error: GH001: Large files detected. You may want to try Git Large File Storage — https://git-lfs.github.com.
remote: error: Trace: b5116d865251981c96d4b32cdf7ef464
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File fixtures/11_user_answer.json is 131.37 MB; this exceeds GitHub’s file size limit of 100.00 MB