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 / docker-compose.yml
Last active Jan 14, 2019
Gitlab Docker Runners
View docker-compose.yml
version: '2'
services:
dind:
restart: always
privileged: true
volumes:
- /var/lib/docker
image: docker:18.06.0-ce-dind
command:
- --storage-driver=overlay2
@iMerica
iMerica / job_offer_decider.py
Created Jul 20, 2018
Job Offer Decision Making Framework
View job_offer_decider.py
from dataclasses import dataclass
from typing import Sequence
""""
This is a proof of concept framework for selecting job offers.
The general idea is to remove emotions from the decision
making process and first think about whats important to you, then
compare each offer against those factors.
@iMerica
iMerica / .gitlab-ci.yml
Last active Jul 18, 2018
Automated Deployments of Create React Apps to Cloudfront using Scotty JS.
View .gitlab-ci.yml
image: docker:latest
services:
- docker:dind
stages:
- build
- push
- deploy
@iMerica
iMerica / urls.py
Last active Oct 28, 2019
Email verification in Django Rest Framework, Django All-Auth, Django Rest-Auth. Suitable for Single Page Applications
View urls.py
urlpatterns = [
url(r'^rest-auth/registration/account-confirm-email/(?P<key>[-:\w]+)/$', ConfirmEmailView.as_view(), name='account_confirm_email'),
]
@iMerica
iMerica / .gitlab-ci.yml
Created Jun 15, 2018
Docker based Gitlab CI workflow for Django
View .gitlab-ci.yml
image: docker:latest
services:
- docker:dind
stages:
- build
- test
- push
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 / storage.py
Created Apr 24, 2018
Django Static Asset Versioning and Auto-Upload to S3/Cloudfront
View storage.py
from storages.backends.s3boto3 import S3Boto3Storage
from django.contrib.staticfiles.storage import ManifestFilesMixin
from tempfile import SpooledTemporaryFile
import os
class CustomStorage(ManifestFilesMixin, S3Boto3Storage):
""" Handles File Versioning + File Uploading to our CDN """
def _save_content(self, obj, content, parameters):
""" Hack to work around I/O error in Boto """
@iMerica
iMerica / remove_old_images.sh
Last active Mar 15, 2018
Delete Docker Images that are older than N days
View remove_old_images.sh
# Example: `remove_old_images 30` // Deletes all Docker Images 30 days or older
function remove_old_images() {
if [ $# -eq 0 ]
then
echo "Pass in the number of days"
exit 0
fi
docker images --format '{{.ID}} {{.CreatedAt}}' | \
awk '{print $1 " " $2 }' | \
View keybase.md

Keybase proof

I hereby claim:

  • I am imerica on github.
  • I am imichael (https://keybase.io/imichael) on keybase.
  • I have a public key ASAK1tg_-_AO3dIyv2usYyUeDQldYkHaLoP97ljTp7LgIgo

To claim this, I am signing this object:

View pycharm.vmoptions
-Xms2048m
-Xmx2048m
-XX:ReservedCodeCacheSize=2048m
-XX:+UseCompressedOops
-Dide.no.platform.update=true
You can’t perform that action at this time.