Skip to content

Instantly share code, notes, and snippets.

View wonderer007's full-sized avatar
🏠
Working from home

Haider Ali wonderer007

🏠
Working from home
View GitHub Profile
@wonderer007
wonderer007 / twitter_encode.sh
Created May 13, 2021 06:07 — forked from vincentriemer/twitter_encode.sh
Script to encode videos optimized for Twitter with ffmpeg. NOTE: Read through the entire script before running and modify to your needs, as it is currently configured for my own environment
#!/usr/bin/env bash
set -e
# usage:
# $ ./encode.sh [INPUT_FILE]
#
# NOTE: The output directory is defined in the script (below) because I use this script with Hazel
# START CONFIGURATION ==================
@wonderer007
wonderer007 / employee_router.rb
Last active March 18, 2021 21:57
Rails dynamic route
class EmployeeRouter
def initialize(&block)
@block = block || (-> { true })
end
def matches?(request)
employee = current_employee(request)
employee.present? && @block.call(employee)
end