Skip to content

Instantly share code, notes, and snippets.

View watzon's full-sized avatar
👀
Looking for work

Chris Watson watzon

👀
Looking for work
View GitHub Profile
@agyild
agyild / FSR.glsl
Last active May 6, 2024 09:48
AMD FidelityFX Super Resolution v1.0.2 for mpv
// Copyright (c) 2021 Advanced Micro Devices, Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
@Blacksmoke16
Blacksmoke16 / test.cr
Last active January 4, 2024 01:09
Test Crinja + Athena integration
require "crinja"
ACF.configuration_annotation Template, name : String
@[ADI::Register]
class HTMLFormatHandler
include Athena::Framework::View::FormatHandlerInterface
private CRINJA = Crinja.new loader: Crinja::Loader::FileSystemLoader.new "#{__DIR__}/../views"
@dammer
dammer / tmbot_handler.cr
Last active February 18, 2021 20:20
Using Tourmaline in Lucky
# Somewhere in src/handlers ...
require "tourmaline"
module Tourmaline
# Sample bot
class EchoBot < Tourmaline::Client
@[Command("echo")]
def echo_command(ctx)
ctx.message.reply(ctx.text)
end
@kbravh
kbravh / README.md
Last active April 22, 2024 08:19
Switch audio output devices on Linux

Audio Output Switcher

This script will cycle to the next available audio output device. It can be tied to a hotkey to easily be triggered. This is handy, for example, for swapping between speakers and headphones.

This script will work on systems running PulseAudio or Pipewire services.

Install

  1. Download the audio-device-switch.sh script and place it in /usr/local/bin.
  2. Make the script executable: sudo chmod 755 /usr/local/bin/audio-device-switch.sh.
  3. Open the Keyboard Shortcuts settings page, add a new shortcut, tell it to execute audio-device-switch.sh, and set up your shortcut!
  4. Install the notify-send library if you want to see a popup notification when the audio device switches: sudo apt install libnotify-bin.
@alexnask
alexnask / README.md
Last active July 5, 2020 05:44
ctregex vs pcre

PCRE2 library and benchmark compiled with JIT support with -O3
Pattern compiled with PCRE2_UTF
ctregex example compiled with --release-fast and use .encoding = .utf8
Example file of 525MB, benchmark cosists of iterating through every line and matching the pattern in the line without anchors (aka search) ten times for every pattern and setting, after warming up.

Guix on WSL2

(updated versions of this document, plus more, live here)

This will show you how to get Guix running on WSL2.
We're going to go as "minimal" as possible, without starting off one of the readily available WSL2 distros.
Parts of this guide should help with understanding how to set up any custom distro on WSL, not just Guix.

Disclaimer: I'm a Guix nOOb! (hence going through the trouble of installing it on WSL2)

@DiegoJeptha
DiegoJeptha / codeMirror_languageModuleLoader.js
Created April 22, 2020 09:31 — forked from rigwild/codeMirror_languageModuleLoader.js
Asynchronously load a CodeMirror language module 🔍🤷‍♀️
/**
* CodeMirror NPM dynamic language module loader.
* To be used with WebPack.
*
* @example
* loadCodeMirrorModule(codeMirrorLanguages.JavaScript.codeMirrorMode)
*
* @author rigwild <https://github.com/rigwild>
* @see https://gist.github.com/rigwild/ce6b4c6a893c3a95f75cc0aca633f037
* @license MIT
@jjvillavicencio
jjvillavicencio / setup.sh
Last active May 5, 2024 12:53
Install Android SDK on Windows Bash (WSL)
cd /home/<user>/
sudo apt-get install unzip
wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
unzip sdk-tools-linux-4333796.zip -d Android
rm sdk-tools-linux-4333796.zip
sudo apt-get install -y lib32z1 openjdk-8-jdk
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH=$PATH:$JAVA_HOME/bin
printf "\n\nexport JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64\nexport PATH=\$PATH:\$JAVA_HOME/bin" >> ~/.bashrc
cd Android/tools/bin
@straight-shoota
straight-shoota / spindle.cr
Last active November 18, 2023 06:10
Spindle - Structured Concurrency for Crystal (PoC)
def bob
10.times do
puts "B"
sleep 0.006
end
end
def alice
3.times do
puts "A"
@gokr
gokr / tt.nim
Created October 27, 2017 07:14
Hack
import httpclient, marshal, json
type
User* = ref object
login*: string
id*: int
avatar_url*: string
gravatar_id*: string
url*: string
html_url*: string