Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View iMerica's full-sized avatar

Michael iMerica

  • Austin, Texas
View GitHub Profile
@iMerica
iMerica / upgrade_pip_packages.py
Last active October 9, 2019 17:17 — forked from serafeimgr/upgrade_pip_packages.py
A python script to upgrade all outdated python packages.
"""
This script upgrades all outdated python packages.
"""
from multiprocessing import Pool, cpu_count
from subprocess import PIPE, Popen
def run_command(command):
"""
@iMerica
iMerica / functional-utils.js
Created December 11, 2018 18:25 — forked from bendc/functional-utils.js
A set of pure ES2015 functions aimed to make functional JavaScript more idiomatic.
// array utils
// =================================================================================================
const combine = (...arrays) => [].concat(...arrays);
const compact = arr => arr.filter(Boolean);
const contains = (() => Array.prototype.includes
? (arr, value) => arr.includes(value)
: (arr, value) => arr.some(el => el === value)

gif-from-tweet

There are so many great GIFs out there and I want to have copies of them. Twitter makes that harder than it should be by converting them to MP4 and not providing access to the source material. To make it easier, I made a bash pipeline that takes a tweet URL and a filename, extracts the MP4 from that tweet and uses ffmpeg to convert back to GIF.

Dependencies

  • ffmpeg
    • macOS: brew install ffmpeg
    • Ubuntu/Debian: apt install ffmpeg
@iMerica
iMerica / viscosity-to-ios-connect.rb
Last active July 5, 2023 21:27 — forked from chrisboulton/viscosity-to-ios-connect.rb
Quickly convert all of your Viscosity connections into OVPN configuration files for OpenVPN for iOS (bundles certificates and keys in the files too)
Dir.glob("#{ENV['HOME']}/Library/Application Support/Viscosity/OpenVPN/*/config.conf").each do |file|
certificate_files = ['ca', 'cert', 'key', 'tls-auth']
config_dir = File.dirname(file)
connection_name = nil
new_config = []
File.read(file).lines.each do |line|
line.strip!
if line.start_with?('#viscosity name')
require 'date'
require 'koala'
class BirthdayLiker
FACEBOOK_TOKEN = ENV['FB_OAUTH_KEY']
BIRTHDAY_WORDS = %w(birthday bday birfday birth born)
THANKS_OPTIONS = ['Thank you!', 'Thanks!', 'Appreciate it!']
DATE_TIME_FORMAT = '%Y-%m-%d'
def initialize(birthdate, opts={})