Skip to content

Instantly share code, notes, and snippets.

View mattpolito's full-sized avatar

Matt Polito mattpolito

View GitHub Profile
@mattpolito
mattpolito / update_slack_status_with_spotify_track.rb
Last active March 16, 2021 13:35
Update Slack status with Spotify track
#!/bin/ruby
require "pathname"
module UpdateSlackStatusWithSpotifyTrack
module_function
DBFILE = Pathname.new("/tmp/current_track")
class Spotify
SpotifyData = Struct.new(
@mattpolito
mattpolito / update-ffmpeg-rpi.sh
Last active August 21, 2022 01:28 — forked from enzanki-ars/update-ffmpeg-rpi.sh
Install/Update FFmpeg with hardware acceleration on the Raspberry Pi
#!/bin/bash
# Compile and install/update (or install via Apt) FFmpeg Codecs
# Compile and install/update FFmpeg suite
# Compile with hardware acceleration
# Modified from https://retroresolution.com/compiling-ffmpeg-from-source-code-all-in-one-script/
echo "Begining Installation of FFmpeg Suite"
#Update APT Repository
echo "Updating the APT repository information"
@mattpolito
mattpolito / keybase.md
Created February 27, 2019 21:35
keybase.md

Keybase proof

I hereby claim:

  • I am mattpolito on github.
  • I am mattpolito (https://keybase.io/mattpolito) on keybase.
  • I have a public key ASBRgyt1TtDYUXk-4azB-IfKFU9FAsYEyUKjbkbhzt5pFgo

To claim this, I am signing this object:

@mattpolito
mattpolito / update_file_creation_date_from_exif.rb
Last active August 29, 2015 14:01
Update file creation dates from exif data
#! /usr/bin/ruby
# requires exiftool: `brew install exiftool`
# Used to update file creation dates when converting RAW photos to JPG
# Converted files receive original file's EXIF data, but not file creation date.
# That date is set to whenever you created the converted file.
# Usage: `> ruby update_file_creation_date.rb ~/Pictures/converted_files/*.*`
@mattpolito
mattpolito / default_formatter.rb
Created January 30, 2013 15:52
Testing system calls
require 'stringio'
class DefaultFormatter
attr_reader :output
def initialize(output = StringIO.new)
@output = output
end
def display(message)
@mattpolito
mattpolito / carrierwave.rb
Created October 28, 2011 01:38
Initialize those Settings
CarrierWave.configure do |config|
config.fog_credentials = {
provider: 'AWS',
aws_access_key_id: Settings.aws.access_key,
aws_secret_access_key: Settings.aws.secret
}
config.fog_directory = Settings.aws.bucket
end
@mattpolito
mattpolito / gist:1232825
Created September 21, 2011 18:05
propane keymando
only /Propane/ do
map "<Cmd-Option-Left>", "<Cmd-Shift-[>"
map "<Cmd-Option-Right>", "<Cmd-Shift-]>"
end
Feature:
Background:
Given the year is 1972
And there is a crack commando unit
And that unit has been sent to prison by a "military court"
And it was a crime they did not commit
Scenario:
Given the men have escaped from a "maximum security stockade" to the "Los Angeles underground"
And today they are still wanted by the government
@mattpolito
mattpolito / keymandorc.rb
Created August 17, 2011 21:02
Keymandorc
# Start Keymando at login
# -----------------------------------------------------------
start_at_login
# Disable Keymando when using these applications
# -----------------------------------------------------------
# disable "Remote Desktop Connection"
# disable /VirtualBox/
# Basic mapping
@mattpolito
mattpolito / gist:1146988
Created August 15, 2011 15:23
keymando Mail.app setup
only "Mail" do
nmap "c", "<Cmd-n>" # New message
nmap "j", "<Down>" # Down
nmap "k", "<Up>" # Up
nmap "e", "<Shift-Cmd-e>" # Archive
nmap "<Shift-3>", "<Cmd-Backspace>" # Delete
nmap "s", "<Shift-Cmd-l>" # Star
nmap "r", "<Cmd-r>" # Reply
nmap "a", "<Shift-Cmd-r>" # Reply all
nmap "f", "<Shift-Cmd-f>" # Forward