Skip to content

Instantly share code, notes, and snippets.

@harubaru
harubaru / wd1-3-release.md
Last active May 27, 2023 15:00
Official Release Notes for Waifu Diffusion 1.3
View wd1-3-release.md
View use-hotkeys.js
// 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)
View application_controller.rb
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
View Pipfile
[[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"
View tailwind.config.js
const defaults = require('./scripts/tailwind.defaults');
module.exports = defaults({
theme: {},
})
@cfra
cfra / pulseaudio-u44.md
Last active February 16, 2023 23:26
Zoom U-44 PulseAudio Setup
View pulseaudio-u44.md

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 May 16, 2023 10:31
Guide to writing an Atom language grammar
View making_language_grammar.md

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
View GitHub-API.md

github API

GitHub GraphQL API

let username = `xgqfrms-GitHub`;
    repo = `Node-CLI-Tools/commits`;
View UserProfile.py
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 May 29, 2023 18:27
Git Submodules basic explanation
View git_submodules.md

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.