Skip to content

Instantly share code, notes, and snippets.

🤖
Building something new

Michael iMerica

🤖
Building something new
  • Austin, LA & NYC.
Block or report user

Report or block iMerica

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@iMerica
iMerica / upgrade_pip_packages.py
Last active Oct 9, 2019 — forked from serafeimgr/upgrade_pip_packages.py
A python script to upgrade all outdated python packages.
View upgrade_pip_packages.py
"""
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 Dec 11, 2018 — forked from bendc/functional-utils.js
A set of pure ES2015 functions aimed to make functional JavaScript more idiomatic.
View functional-utils.js
// 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)
View gif-from-tweet.md

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 Oct 21, 2018 — 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)
View viscosity-to-ios-connect.rb
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')
View birthday_liker.rb
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={})
You can’t perform that action at this time.