Skip to content

Instantly share code, notes, and snippets.

View itsbrex's full-sized avatar
🎯
focusing

Brian Roach itsbrex

🎯
focusing
View GitHub Profile
@leandrochiarini
leandrochiarini / arxiv-today.py
Created March 29, 2023 18:42
Command line interface to look for arxiv articles from today using fzf. It also saved all opened articles
#!/usr/bin/env python3
import arxiv
import feedparser
import re
import os
from pathlib import Path
from pyfzf.pyfzf import FzfPrompt
import webbrowser
import argparse
import sys
@steven-tey
steven-tey / valid-chatgpt-ip.ts
Created March 27, 2023 03:05
Typescript code to verify if an incoming request's IP address is from OpenAI's CIDR block
function ipToInt(ip: string) {
return ip.split(".").reduce((acc, octet) => (acc << 8) + parseInt(octet), 0);
}
function isIpInCIDR(ip: string, cidr: string) {
const [cidrIp, prefixLength] = cidr.split("/");
const mask = -1 << (32 - parseInt(prefixLength));
const ipInt = ipToInt(ip);
const cidrIpInt = ipToInt(cidrIp);
@groupdocs-cloud-gists
groupdocs-cloud-gists / Convert_CSV_to_XML_in_Python.py
Last active December 14, 2023 05:41
Convert XML to CSV and CSV to XML in Python
# How to Convert CSV to XML in Python using REST API
try:
# Create an instance of the API
convert_api = groupdocs_conversion_cloud.ConvertApi.from_keys(client_id, client_secret)
# Define convert settings
settings = groupdocs_conversion_cloud.ConvertSettings()
settings.storage_name = storage_name
settings.file_path = "python-testing/input-sample-file.csv"
settings.format = "xml"
Term Description
1TR One True Recovery; booting into macOS recovery on Apple Silicon by holding the power button to verify physical presence; enables interaction with SEP to change Boot Policy
AA Apple account
AA Apple Archive, see also Apple Encrypted Archive; command line tools: aa, aea, compression_tool
AAC Automatic Assessment Configuration; AutomaticAssessmentConfiguration.framework; puts device in a locked mode for exam-style test applications
AAT Apple Advanced Typography; font format and rendering engine
Accounts launchd service: com.apple.accountsd; /System/Library/Accounts
ACDE Apple Connect Device External? ACDEClient.framework, old two-step verification, derived from a company-internal AppleConnect system? server: appleconnect.apple.com
ACFS Apple Clustered File System; deprecated file system for Xsan; acfs.framework
Acoustic ID Siri feature to recognize songs
@GetVladimir
GetVladimir / Setup-iCloud+-Custom-Domain-Catch-All-email-with-Gmail.md
Last active May 31, 2024 18:31
How to setup iCloud+ Custom Domain Catch All email with Gmail

How to setup iCloud+ Custom Domain Catch All email with Gmail

I've recently tested on how to move the custom domain catch all email from G Suite to the new iCloud+ Catch All feature and wanted to share my experience.

The end result is having Custom Domain email and Catch All routing, that can be fully used via Gmail, including receiving and sending emails.


The steps

  • Setup your Custom Domain (or subdomain) with iCloud+
@jimmywarting
jimmywarting / reload.js
Last active February 20, 2024 21:13
Simple dependency free file auto-reload (NodeJS)
import { watch } from 'node:fs/promises'
import { Worker } from 'node:worker_threads'
let worker = new Worker('./app.js')
async function reloadOnChange (dir) {
const watcher = watch(dir, { recursive: true })
for await (const change of watcher) {
if (change.filename.endsWith('.js')) {
worker.terminate()
@pesterhazy
pesterhazy / building-sync-systems.md
Last active June 10, 2024 23:55
Building an offline realtime sync engine

So you want to write a sync system for a web app with offline and realtime support? Good luck. You might find the following resources useful.

Overview articles

@frolleks
frolleks / DECOMPILING_AN_ELECTRON_APP.md
Last active June 12, 2024 00:37
How to decompile an Electron app

Let me tell you how easy it is to decompile an Electron app (that's closed source).

Prerequisites

Decompilation

First of all, you find the install path of your Electron app. If you found it, find the resources folder. If you found it, you'll have to install asar globally, by running:

@mbaric
mbaric / s3-get.sh
Last active December 4, 2023 05:41 — forked from mmaday/s3-get.sh
S3 signed GET in plain bash (Requires openssl and curl)
#!/usr/bin/env bash
#
# Usage:
# s3-get.sh <bucket> <region> <source-file> <dest-path>
#
# Description:
# Retrieve a secured file from S3 using AWS signature 4.
# To run, this shell script depends on command-line curl and openssl
#
# References:
@kylemcdonald
kylemcdonald / split.py
Created May 15, 2022 07:58
Split an audio file into multiple files given a list of timestamps exported from timestamps.me out of an Ableton set.
import subprocess
track_fn = 'audio.wav'
timestamps_fn = 'timestamps.csv'
with open(timestamps_fn) as f:
lines = f.read().splitlines()
lines = [e.split(',')[2] for e in lines]
cmd_string = 'ffmpeg -hide_banner -loglevel error -i {tr} -acodec copy -ss {st} -to {en} {nm}'