Skip to content

Instantly share code, notes, and snippets.

@vyder
vyder / hathora.code-snippets
Created May 8, 2022 10:23
Hathora Code Snippets for VSCode
{
// Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
// Example:
// "Print to console": {
// "scope": "javascript,typescript",
@vyder
vyder / unlock-pdf
Created March 25, 2022 18:10
Ruby script to batch unlock pdfs in-place using qpdf (installed via homebrew)
#!/usr/bin/env ruby
files = ARGV.dup
password = files.shift
cmd = "qpdf"
options = "--decrypt --password=#{password} --replace-input"
files.each do |filename|
print "Unlocking #{filename}..."
@vyder
vyder / quotes.json
Last active December 27, 2020 16:13
Random motivational quotes
[{
"content": "The infinite player wakes up every single day and says\n\"How can I be better than I was last week?\""
}, {
"content": "journey before destination",
"author": "The Knights Radiant"
}, {
"content": "[…] if we accept the person we are when we fall, the jounrey ends. That failure _becomes_ our destination",
"author": "Dalinar Kholin"
}, {
"content": "Sometimes a hypocrite is nothing more than a man in the process of changing",
@vyder
vyder / fixLinksOnLoad.js
Created September 14, 2020 12:29
Markdown Footnotes
$(document).ready(function() {
// Find all footnotes
const $footnotes = $("ol:last > li");
const $refs = $("sup > a");
$footnotes.each(function(i, footnote) {
const num = (i + 1);
const $ref = $($refs[i]);
@vyder
vyder / keybase.md
Created September 1, 2020 11:40
Keybase Github Verification

Keybase proof

I hereby claim:

  • I am vyder on github.
  • I am vidur (https://keybase.io/vidur) on keybase.
  • I have a public key ASDSjNB2PoUNupvOnLbKJI_A2Tjgg4yvXoBgPtsbufvfNgo

To claim this, I am signing this object:

@vyder
vyder / list-32-bit-apps
Created October 9, 2019 08:59
A ruby script to list 32-bit apps installed in macOS - in preparation of upgrading to macOS Catalina
#!/usr/bin/env ruby
# Run `gem install plist` to resolve the only dependency.
#
# This script creates two files in the directory that you run the script from
#
require 'plist'
require 'yaml'
Wordlist ver 0.732 - EXPECT INCOMPATIBLE CHANGES;
acrobat africa alaska albert albino album
alcohol alex alpha amadeus amanda amazon
america analog animal antenna antonio apollo
april aroma artist aspirin athlete atlas
banana bandit banjo bikini bingo bonus
camera canada carbon casino catalog cinema
citizen cobra comet compact complex context
credit critic crystal culture david delta
dialog diploma doctor domino dragon drama
@vyder
vyder / README.md
Created May 30, 2017 08:24
Ubuntu: List upstart services + status

This is a ruby script to pretty print the output of initctl list.

@vyder
vyder / rbenv-in-xcode-build-script.md
Created October 17, 2016 09:24
Using rbenv in an XCode 'Run Script Phase'

If anybody stumbles across this from Google, I found that the simplest thing to do was:

Have devs install rbenv on their machines, and add ~/.rbenv/shims to the PATH in the XCode build script like:

export PATH=~/.rbenv/shims:$PATH
# Exec rest of your script
# ...

@vyder
vyder / alternative.md
Last active October 6, 2016 07:08
Writing a disk image to a flash drive/SD card from OSX

Or, just install hypriot/flash and run:

$ flash /path/to/img

It also prints a pretty progress bar for dd, which is incredibly useful.