Skip to content

Instantly share code, notes, and snippets.

Everybody's a critic

Mo Beigi mobeigi

Everybody's a critic
View GitHub Profile
import praw
import regex as re
reddit = praw.Reddit(
submission = reddit.submission(id="pfpyxc")
mobeigi / seed_finder.js
Created Aug 21, 2021
Steam Market Seed Finder (CSGOFloat extension)
View seed_finder.js
var seeds = document.getElementsByClassName('csgofloat-itemseed');
var patterns = [101,404,684];
for (var i = 0; i < seeds.length; ++i) {
var seed = Number(seeds[i].textContent.replace('Paint Seed: ', ''));
if (patterns.includes(seed)) {
console.log("Found seed: " + seed);
mobeigi /
Created Jun 26, 2021
Convert IBKR Last365CalendarDays (JSON) file to Sharesight Bulk Trades CSV File
import json
from datetime import datetime
# Read Last365CalendarDays.json file
with open('Last365CalendarDays.json') as json_file:
data = json.load(json_file)
def convert_date(date):
date_obj = datetime.strptime(date, "%Y-%m-%dT%H:%M:%S.%fZ")
mobeigi /
Created Dec 7, 2020
Cyberpunk 2077 GoG Game Price Scraper
import mechanicalsoup
import json
URL = ''
country_codes = ['AR','AU','AT','BS','BE','BO','BR','CA','CL','CN','CO','CR','HR','CU','CZ','DK','DO','EC','EG','SV','FI','FR','DE','GR','GT','HN','HK','IN','IE','IL','IT','JM','JP','LU','MX','MA','NL','NZ','NI','NG','NO','PY','PE','PL','PT','PR','RU','SA','ZA','ES','SE','CH','TW','TR','UK','US','UY','VE','SD','II','AF','AL','DZ','AO','AG','AW','AZ','BH','BD','BB','BY','BZ','BM','BT','BW','VG','BN','BG','BF','MM','BI','CM','CV','KY','KM','CG','CY','YE','DJ','DM','GQ','EE','FJ','GA','GM','GH','GD','GN','GW','GY','HT','HU','IS','ID','IR','CI','JO','KE','KW','KP','KG','LA','LV','LB','LR','LI','LT','MG','MY','ML','MT','MR','MN','MC','MZ','NP','AN','NE','OM','PK','PA','PH','QA','RO','KN','LC','VC','WS','SN','SG','SB','SZ','SY','TH','TT','TN','UA','AE','VN','YU','ZW','ZR','ET','KV','AX','AS','AD','AI','AQ','AM','BJ','BA','BV','IO','KH','CF','TD','CX','CC','CD','CK','ER','FK','FO','GF','PF','TF',
View tws.vmoptions
# This file contains VM parameters for Trader Workstation.
# Each parameter should be defined in a separate line and the
# last line must be followed by a line feed. No leading or
# trailing whitespaces are allowed in the same line, where a
# parameter is defined.
# Lines starting with a '#' character are treated as comments
# and ignored. Additionally, if a line contains a
# '### keep on update' string, all parameters defined below will
mobeigi / slack_user_noti_pref_bulk_update.js
Last active Jul 30, 2022
Slack User Notification Preference Bulk Update
View slack_user_noti_pref_bulk_update.js
// Slack User Notification Preference Bulk Update
// By Mo Beigi
const slackTeamId = "EXAMPLE17";
const localConfigJson = JSON.parse(localStorage.localConfig_v2);
const slackUrl = localConfigJson.teams[slackTeamId].url;
let channel_ids = [];
// client.boot contains list of channel ids user is subscribed to amongst other things
await fetch(slackUrl + "api/client.boot?" +
mobeigi / commit-msg
Created Jul 25, 2020
Git Commit Message Hook for JIRA Issue Keys
View commit-msg
# The script below adds the branch name automatically to
# every one of your commit messages. The regular expression
# below searches for JIRA issue key's. The issue key will
# be extracted out of your branch name
# A variant of grep support the -P flag for PCRE is required
mobeigi / alertmanager_webhook_payload_example.json
Last active Jul 13, 2022
Alertmanager Webhook Payload Example
View alertmanager_webhook_payload_example.json
"receiver": "webhook",
"status": "firing",
"alerts": [
"status": "firing",
"labels": {
"alertname": "Test",
"dc": "eu-west-1",
"instance": "localhost:9090",
mobeigi /
Created Jul 3, 2020
Linux Server Backup Script for Files + MySQL Databases
#!/usr/bin/env bash
# Server Backup Script
# Backs up:
# MySQL databases
# Important files on file system
# Variables
TIMESTAMP=$(date +"%d-%m-%Y_%H-%M-%S")
mobeigi / TargetAwareLink.tsx
Last active Jul 3, 2021
React Router Link for internal/external links
View TargetAwareLink.tsx