Skip to content

Instantly share code, notes, and snippets.

Avatar

Roger Steve Ruiz rogeruiz

View GitHub Profile
View .aliases
limpiaGit() {
git remote prune origin
git branch --merged | rg -v "(^\*|main)" | xargs git branch -d
}
alias limpia-git=limpiaGit
View create_markdown_from_cards.py
import wikipedia
from bs4 import BeautifulSoup, Tag
import datetime
import urllib.parse
from ankisync2.apkg import Apkg
from ankisync2.anki20 import db
if __name__ == "__main__":
@rogeruiz
rogeruiz / .aliases
Created Jun 9, 2021
Get Tick timers for today with an optional filter
View .aliases
tickDay() {
timerIs=$1
today=$(date +"%m-%d")
tick list | rg "${today}" | rg "${timerIs}"
}
alias tick-today=tickDay
@rogeruiz
rogeruiz / Cargo.toml
Last active Jun 4, 2021
Testing config-rs and shellexpand to read from a YAML file.
View Cargo.toml
[package]
name = "test-config-with-shellexpand"
version = "0.1.0"
edition = "2018"
[dependencies]
config = "0.11.0"
shellexpand = "2.1.0"
View Dockerfile
# Tick Linux image for Ubuntu with all the necessary dependencies and
# environment variables. This Dockerfile can be used to test assertions that
# Tick was installed properly on Linux Ubuntu 18.04 and that it runs without
# needing to run `diesel_cli` commands to run the initial migraitons. This
# example is the first step to shipping a single binary for Tick cross-platform.
#
# Because of the life cycle of Docker containers, this container can only be
# used to run Tick commands in an ephemeral matter. Starting timers will only
# create timers which get destroyed when the tick command exits and the
# container is destroyed.
View hola-mundo.exs
IO.puts("Hola mundo desde Elixir!")
:timer.sleep(1000 * 1)
IO.puts("\nY eso es todo por ahora...")
View Makefile
# This is a template Makefile that I use for automating projects that might
# require one.
#
# For more guidance around Makefiles, the checkout out the helpful
# [makefiletutorial](https://makefiletutorial.com/).
directory = tmp
check_defined = \
$(strip $(foreach 1,$1, \
@rogeruiz
rogeruiz / intensify.sh
Created Jul 2, 2019 — forked from alisdair/intensify.sh
intensifies Slack emoji creator
View intensify.sh
#!/bin/bash
# Generate a `:something-intensifies:` Slack emoji, given a reasonable image
# input. I recommend grabbing an emoji from https://emojipedia.org/
set -euo pipefail
# Number of frames of shaking
count=10
# Max pixels to move while shaking
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
View cg-container-networking.markdown

Tech talk lite: cloud.gov container networking

       _                 _
      | |               | |
   ___| | ___  _   _  __| |  __ _  _____   __
  / __| |/ _ \| | | |/ _` | / _` |/ _ \ \ / /
 | (__| | (_) | |_| | (_| || (_| | (_) \ V /
  \___|_|\___/ \__,_|\__,_(_)__, |\___/ \_/
                             __/ |
                            |___/