Skip to content

Instantly share code, notes, and snippets.

Avatar

Patrick Dill jpatrickdill

View GitHub Profile
@jpatrickdill
jpatrickdill / threaddump.py
Last active Jul 21, 2020
indexes all images from an instagram thread
View threaddump.py
from selenium import webdriver
import requests
import figa
from redis import Redis
from pprint import pp
@figa.config
class Config:
default = "config.json"
View config.json
{
"number": 12,
"string": "Hello, world!",
"fruits": ["apple", "pear"],
"person": {
"name": "Zach",
"age": 20
}
}
View httpservice.lua
local url_query = {arg1="val1", arg2="val2"}
local post_json = {a=1, b=2, this="is json"}
local HttpService = game:GetService("HttpService")
local options = {
Url = ("https://httpbin.org/post?%s=%s&%s=%s"):format("arg1", url_query.arg1, "arg2", url_query.arg2),
Method = "POST",
Headers = {["Content-Type"] = "application/json"},
Body = HttpService:JSONEncode(post_json)
View colors.lua
local rgb = Color3.fromRGB
local Color = {
Red = {
[50] = rgb(255, 235, 238);
[100] = rgb(255, 205, 210);
[200] = rgb(239, 154, 154);
[300] = rgb(229, 115, 115);
[400] = rgb(239, 83, 80);
@jpatrickdill
jpatrickdill / httpservice.lua
Created Jun 27, 2019
Some HttpService code
View httpservice.lua
local HttpService = game:GetService("HttpService")
local options = {
Url = "https://httpbin.org/post?arg=value",
Method = "POST",
Headers = {["Content-Type"] = "application/json"},
Body = HttpService:JSONEncode( {this="json"} )
}
local r = HttpService:RequestAsync(options)
@jpatrickdill
jpatrickdill / discriminator.js
Created Mar 20, 2018
User bot that finds users with same discriminator.
View discriminator.js
const Discord = require("discord.js");
const client = new Discord.Client();
client.on("ready", () => {
console.log("ready");
});
client.on("message", message => {
if ((message.author === client.user) && (message.content.substring(0, 2) === "%%")) {
@jpatrickdill
jpatrickdill / undeleter.js
Last active Jul 30, 2020
Listens for deleted messages on discord and dumps them to a channel.
View undeleter.js
const Discord = require("discord.js");
const client = new Discord.Client();
const config = require("./config.json"); // config from file
/* example config.json:
{
"token": "abcdefghijklmnopqrstuvwxyz", // user or bot token,
"listenTo": ["167423382697148416", "353615025589714946", "210321071511961600"], // list of channel OR guild id's