Skip to content

Instantly share code, notes, and snippets.

View jsnns's full-sized avatar
🚀

Jacob Sansbury jsnns

🚀
View GitHub Profile
@jsnns
jsnns / DragGuard.tsx
Last active November 1, 2021 22:22
Drag and drop wrappers for complex drag and drop editors
import React from "react";
interface DragGuardProps {}
/**
* DragGuard prevents dragging by touch-enabled children like form controls, buttons, or links
*/
export const DragGuard: React.FC<DragGuardProps> = ({ children }) => {
return <div onMouseDown={(e) => e.stopPropagation()}>{children}</div>;
};
@jsnns
jsnns / delete-all-messages.js
Created November 13, 2019 22:33 — forked from rcx/delete-all-messages.js
Delete all your messages in a Discord channel
/*
* Discord: Don't copy stuff into this box
* Me: dOn'T COpy sTuFf iNtO tHIs bOx
*/
clearMessages = function (guild_id, author_id, authToken, deleted = new Set()) {
const searchURL = `https://discordapp.com/api/v6/guilds/${guild_id}/messages/search?author_id=${author_id}&include_nsfw=true`
const headers = { Authorization: authToken }
let clock = 0
interval = 500
function delay(duration) {
git clone git@github.com:jsnns/dotfiles.git ~/.me
bash ~/.me/install.sh
import datetime
import pytz
import dateutil.parser
def to_utc(str, *, zulu_marker=False):
# string formats
from_format = '%m/%d/%Y %I:%M:%S %p'
to_format = '%m/%d/%Y %H:%M:%S'
# arrays
integer = input("What's your favorite number? ")
if integer == 13:
print("LIAR!")
elif integer == 7:
print("You must be Marshal")
else:
print("Cool your favorite number is: " + str(integer))
### Keybase proof
I hereby claim:
* I am jsnns on github.
* I am jsansbury (https://keybase.io/jsansbury) on keybase.
* I have a public key ASAmBoSir_CxygEj4IIlE_7Yd-Dixs1iERSIaZ75rcjTXgo
To claim this, I am signing this object: