Skip to content

Instantly share code, notes, and snippets.

View dirtslayer's full-sized avatar
🏠
Working from home

Darrell Dupas dirtslayer

🏠
Working from home
  • Redwater, Alberta, Canada
  • 01:05 (UTC -07:00)
View GitHub Profile
@ddanier
ddanier / git-cc.nu
Last active July 4, 2025 15:50
Conventional commit as `git cc` custom command for nu shell
# This nu modules adds "git cc" to create commits following the conventional commit schema, see
# https://www.conventionalcommits.org/en/v1.0.0/
#
# Example usage:
# git cc -t feat -s my-feature -i my-issue -m "My feature"
# git cc fix -s my-fix -m "My fix"
#
# Is uses a slightly extended version of conventional commits to also include a commit type
# emoji and a commit issue. The commit scope will be inferred from the current git status,
# using changes folder names by default (using the "git cc-get-scope" command also provided
@nevillepark
nevillepark / README.md
Last active November 7, 2024 22:23
CBC MP3 stream urls
@michezio
michezio / openbox_window_snap_keybindings.xml
Last active December 30, 2024 17:23
Openbox keybindings to snap active window at side or corner of the screen
<!-- add this to ~/.config/openbox/rc.xml or lxde-rc.xml, lxqt-rc.xml or similar -->
<!-- use Ctrl + Alt + NumPad to move the window to the corrisponding position of the screen -->
<keyboard>
<!-- 5, Maximize the window -->
<keybind key="C-A-KP_5">
<action name="MaximizeFull"/>
</keybind>
// Discord all events!
// A quick and dirty fleshing out of the discord.js event listeners (not tested at all!)
// listed here -> https://discord.js.org/#/docs/main/stable/class/Client
// Learn from this, do not just copy it mofo!
//
// Saved to -> https://gist.github.com/koad/316b265a91d933fd1b62dddfcc3ff584
// Last Updated -> Halloween 2022
/*
@TooTallNate
TooTallNate / jsfunc.sh
Created June 20, 2018 05:37
Write JavaScript functions - use as bash functions
#!/bin/bash
jsfunc() {
local code="$(cat)"
local fn="$(cat <<EOFF
$1() {
node <(cat <<EOF
require('stream').Readable.prototype.then = function (...args) { return new Promise((res, rej) => { const bufs = []; this.on('error', rej).on('data', buf => bufs.push(buf)).on('end', () => res(Buffer.concat(bufs))); }).then(...args) };
(async () => {
${code}
})().then(val => typeof val !== 'undefined' && console.log(typeof val === 'string' ? val : JSON.stringify(val, null, 2))).catch(err => console.error(err.stack) || process.exit(1));
@TooTallNate
TooTallNate / http-error.js
Created August 3, 2016 00:48
HTTPError class for JavaScript HTTP errors
import { format } from 'url';
import { STATUS_CODES } from 'http';
import uppercamelcase from 'uppercamelcase';
class HTTPError extends Error {
constructor(code, message, extras) {
super(message || STATUS_CODES[code]);
if (arguments.length >= 3 && extras) {
Object.assign(this, extras);
}