Skip to content

Instantly share code, notes, and snippets.

View torrobinson's full-sized avatar
🟣

Tor torrobinson

🟣
View GitHub Profile
@oktomus
oktomus / fork-custom-commands.md
Last active November 11, 2025 13:00
Fork custom commands

With custom commands, you are one shortcut away to run commands thanks to the Quick Launch (Ctrl+P, ⌘+P).

Custom commands can be configured in File > Preferences > Custom commands, or by editing the json file custom-commands.json located in AppData/Local/Fork on Windows and ~/Library/Application Support/com.DanPristupov.Fork/custom-commands.json on MacOS.

Please share your own custom commands :)

How to use

Fork commands are posted as comments on this gist. Press CTRL+F to search for commands.

@AymaneHrouch
AymaneHrouch / autosub_reddit.js
Last active December 4, 2025 10:16
Auto subscribe to a lot of subreddits after you move to a new account.
/*
-Visit https://old.reddit.com/subreddits/ using your old account
-Copy link address of "multireddit of your subscriptions"
It will give you a link address like this: https://old.reddit.com/r/[subreddit1+subreddit2...+subredditN]
Please note that if you have a lot of subreddits the link won't work because there's a limit to the link's length, you can simply split it to two or three links
-Visit that link (or links) using your new account.
-Open the console by pressing F12 and then clicking the console tab
-Past the code bellow and press enter. You're welcome :)
*/
const sub = () => {
@torrobinson
torrobinson / dates.sql
Last active September 24, 2021 16:57
DB2 JDE Date Helpers
-- Getting Gregorian Date from Julian Column:
CASE WHEN [JULIAN] IS NULL OR [JULIAN] = 0 THEN '' ELSE CAST(CAST(CAST(((CAST(([JULIAN]-MOD([JULIAN],1000))/1000 AS INT)+1900)*1000)+MOD([JULIAN],1000) AS CHAR(7)) AS DATE) AS CHAR(10)) END
-- Getting Time from 6-digit time (130045 = 1:00:45pm)
CAST(SUBSTR([TIMESTR],1,2) || ':' || SUBSTR([TIMESTR],3,2) || ':' || SUBSTR([TIMESTR],5,2) as TIME)
-- Current Date in JDE Julian Format:
select (YEAR(NOW()) - 1900) || LPAD(DAYOFYEAR(NOW()),3,'0') from sysibm.sysdummy1;
--or
select (100000+(YEAR(curdate())-2000)*1000+dayofyear(curdate())) from sysibm.sysdummy1;
@consti
consti / hosts
Last active May 14, 2025 15:51
/etc/hosts to block shock sites etc.
# This hosts file is brought to you by Dan Pollock and can be found at
# http://someonewhocares.org/hosts/
# You are free to copy and distribute this file for non-commercial uses,
# as long the original URL and attribution is included.
#<localhost>
127.0.0.1 localhost
127.0.0.1 localhost.localdomain
255.255.255.255 broadcasthost
::1 localhost
@adamjohnson
adamjohnson / publickey-git-error.markdown
Last active July 7, 2025 18:00
Fix "Permission denied (publickey)" error when pushing with Git

"Help, I keep getting a 'Permission Denied (publickey)' error when I push!"

This means, on your local machine, you haven't made any SSH keys. Not to worry. Here's how to fix:

  1. Open git bash (Use the Windows search. To find it, type "git bash") or the Mac Terminal. Pro Tip: You can use any *nix based command prompt (but not the default Windows Command Prompt!)
  2. Type cd ~/.ssh. This will take you to the root directory for Git (Likely C:\Users\[YOUR-USER-NAME]\.ssh\ on Windows)
  3. Within the .ssh folder, there should be these two files: id_rsa and id_rsa.pub. These are the files that tell your computer how to communicate with GitHub, BitBucket, or any other Git based service. Type ls to see a directory listing. If those two files don't show up, proceed to the next step. NOTE: Your SSH keys must be named id_rsa and id_rsa.pub in order for Git, GitHub, and BitBucket to recognize them by default.
  4. To create the SSH keys, type ssh-keygen -t rsa -C "your_email@example.com". Th
@shawndumas
shawndumas / soundex.js
Last active March 28, 2025 12:42
Soundex in JavaScript
var soundex = function (s) {
var a = s.toLowerCase().split(''),
f = a.shift(),
r = '',
codes = {
a: '', e: '', i: '', o: '', u: '',
b: 1, f: 1, p: 1, v: 1,
c: 2, g: 2, j: 2, k: 2, q: 2, s: 2, x: 2, z: 2,
d: 3, t: 3,
l: 4,