Skip to content

Instantly share code, notes, and snippets.

@harubaru
harubaru / wd1-3-release.md
Last active June 5, 2024 03:22
Official Release Notes for Waifu Diffusion 1.3
// useHotkeys.js
import hotkeys from "hotkeys-js";
export const bindHotkeys = (controller) => {
hotkeys.filter = () => true;
for (const [hotkey, handler] of Object.entries(
controller.constructor.hotkeys
)) {
hotkeys(hotkey, (e) => controller[handler](e));
@leastbad
leastbad / application_controller.rb
Created March 25, 2021 16:05
Notifications are fun (Devise, Bootstrap 5, Notyf, FontAwesome)
class ApplicationController < ActionController::Base
include CableReady::Broadcaster
include Toastable
end
@DamnedScholar
DamnedScholar / Pipfile
Created February 22, 2021 19:53
pipenv bug with importing requirements.txt
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
aioredis = "==1.3.1"
alembic = "==1.4.2"
amqp = "==2.6.0"
anyjson = "==0.3.3"
const defaults = require('./scripts/tailwind.defaults');
module.exports = defaults({
theme: {},
})
@cfra
cfra / pulseaudio-u44.md
Last active July 31, 2023 14:57
Zoom U-44 PulseAudio Setup

Zoom U-44 PulseAudio Setup

Problem Statement

The Zoom U-44 works out of the box with recent Linux versions.

By default, PulseAudio will register it as a single sink with 4 output channels. As the U-44 is organized to have two stereo pairs for outputs, there are situations where it is more useful to have 2 separate sinks available, each playing back to one of the two stereo pairs.

@Aerijo
Aerijo / making_language_grammar.md
Last active March 18, 2024 05:03
Guide to writing an Atom language grammar

A guide to writing a language grammar (TextMate) in Atom

Tree sitter

  • Atom is transitioning to an entirely new way of defining grammars using tree-sitter. This will be enabled by default quite soon now. It is theoretically faster and more powerful than regex based grammars (the one described in this guide), but requires a steeper learning curve. My understanding is that regex based grammars will still be supported however (at least until version 2), so this guide can still be useful. To enable it yourself, go to Settings -> Core and check Use Tree Sitter Parsers

Links for tree-sitter help:

@xgqfrms-GitHub
xgqfrms-GitHub / GitHub-API.md
Last active November 10, 2020 14:54
GitHub GraphQL API

github API

GitHub GraphQL API

let username = `xgqfrms-GitHub`;
    repo = `Node-CLI-Tools/commits`;
from django import forms
from django.contrib.auth.models import User
class UserProfileForm(forms.ModelForm):
class Meta:
model = User
fields = ['first_name', 'last_name', 'email']
@gitaarik
gitaarik / git_submodules.md
Last active June 18, 2024 00:44
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:

  • Separate big codebases into multiple repositories.