Skip to content

Instantly share code, notes, and snippets.

View Alexhuszagh's full-sized avatar

Alexander Huszagh Alexhuszagh

View GitHub Profile
@Alexhuszagh
Alexhuszagh / selenium_twitter.py
Last active November 27, 2022 15:44
Selenium-based Twitter scraper
#!/usr/bin/env python
'''
selenium_twitter
================
Uses selenium to extract Tweets from Twitter
for a given user. Note that this breaks Twitter's
ToS and you can easily get banned for doing this.
I highly recommend you do not do this while logged in,
or on the same IP address as your main account.
@Alexhuszagh
Alexhuszagh / export_twitter.py
Last active November 23, 2022 20:56
Script to export Twitter data (statuses, friends, followers).
#!/usr/bin/env python
'''
export_twitter
==============
Export data information from Twitter, including friends, followers,
statuses, and more. Note that the API JSON document should look like:
{
"consumer_key": "...",
@Alexhuszagh
Alexhuszagh / export_friends.py
Created November 14, 2022 22:03
Utility to export who you follow/follows you on Twitter.
#!/usr/bin/env python
'''
export_friends
==============
Export friend information from Twitter. Note that
the API JSON document should look like:
{
"consumer_key": "...",
@Alexhuszagh
Alexhuszagh / dump_attachments.py
Last active April 1, 2022 23:02
Script to dump and remove attachments from Evernote ENEX files.
#!/usr/bin/env python3
'''
attachments
===========
Dump all the attachments in an ENEX file,
and export the attachment-less ENEX file to disk.
'''
# This is free and unencumbered software released into the public domain.
@Alexhuszagh
Alexhuszagh / bundler.py
Last active July 7, 2021 21:43
Scripts to include and use to bundle Python imports from modules into a single source file.
'''
Scripts to convert pure-Python modules into a Python dictionary, which can then be reconverted
into Python modules, allowing distribution of code with complex imports in a single script.
This code is unlicensed and free and unencumbered code in the public domain.
'''
import os
import sys
import types
@Alexhuszagh
Alexhuszagh / jp2zip2cbz.sh
Last active June 13, 2021 06:39
Convert jp2.zip archives to CBZ archives.
#!/bin/bash
# Convert an achive of zipped JP2 files to a CBZ archive.
# Must have ImageMagick with the JP2 extensions enabled.
set -ex
# Get our arguments, and unzip the file.
input="$1"
input_dir=$(dirname "$input")
input_basename=$(basename "$input")
@Alexhuszagh
Alexhuszagh / result.py
Last active February 16, 2020 20:58
Rust-style Result for Python
'''
result
------
Rust-style results and decorator for Python.
Note: I don't personally advocate using it in production, but it's a much better
option than using the following:
https://twitter.com/DinisCruz/status/1229058078714351616
@Alexhuszagh
Alexhuszagh / send_text.py
Last active October 12, 2019 03:46
Programmatically Send Text to Cell Phone
#!/usr/bin/env python
'''
send_text
=========
Send text with a message.
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
@Alexhuszagh
Alexhuszagh / block_followers.py
Last active August 30, 2019 14:23
Block Followers of Accounts
'''
block_followers
===============
Block followers of a given account.
Block followers **does** not block an account if:
1. The account is verified (override with the `whitelist_verified=False`).
2. You are following the account (override with `whitelist_following=False`).
@Alexhuszagh
Alexhuszagh / memchr_simd.rs
Created August 4, 2019 20:52
memchr implementation with portable SIMD instructions using packed_simd. Nightly-only.
// This is derived off of BurntSushi's rust-memchr, and is re-released under
// the same licensing conditions as rust-memchr.
//
// Dual-licensed under MIT or the UNLICENSE.
//
// LICENSE
// =======
//
// This is free and unencumbered software released into the public domain.
//