This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Someetimes `vagrant up` fails with a message like: | |
# Installing the 'vagrant-butcher' plugin. This can take a few minutes... | |
# Bundler, the underlying system Vagrant uses to install plugins, | |
# reported an error. The error is shown below. These errors are usually | |
# caused by misconfigured plugin installations or transient network | |
# issues. The error from Bundler is: | |
# | |
# An error occurred while installing rack (2.0.1), and Bundler cannot continue. | |
# Make sure that `gem install rack -v '2.0.1'` succeeds before bundling. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- MySQL | |
-- Search all tables, databse-wide, for a column name. | |
-- EXACT MATCH | |
SELECT DISTINCT TABLE_NAME | |
FROM INFORMATION_SCHEMA.COLUMNS | |
WHERE COLUMN_NAME IN ('col_name') | |
AND TABLE_SCHEMA='db_name'; | |
-- PARTIAL MATCH |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%span{ style: "font-family: 'FontAwesome';" } | |
- (61440..61720).each do |n| | |
= ('&#' + n.to_s).html_safe; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 4:3 | |
1.333.to_r.rationalize(Rational('0.001')) | |
# => (4/3) | |
# 16:9 | |
1.778.to_r.rationalize(Rational('0.001')) | |
# => (16/9) | |
# Common PAR: | |
1.212.to_r.rationalize(Rational('0.001')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Match from beginning of line to last occurrence of slash (/). Great for parsing filename off full paths. | |
# ^.*/(?!.*/) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -qr dir dir2 | grep -v -e '.DS_Store' -e '.git' -e '.log' | sort > diffs.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Do the Find first, as a trial run. | |
find . -type d \( ! -iname "7604e960-3fc9-012f-2342-52540002105a" ! -iname "760660a0-3fc9-012f-2342-52540002105a" ! -iname "cac012a0-46b5-012f-1584-52540002105a" ! -iname "981fc740-8bf0-012f-2d2b-52540002105a" ! -iname "e268a4d0-95f6-012f-c815-52540002105a" \) | |
# Then do the actual delete. | |
find . -type d \( ! -iname "7604e960-3fc9-012f-2342-52540002105a" ! -iname "760660a0-3fc9-012f-2342-52540002105a" ! -iname "cac012a0-46b5-012f-1584-52540002105a" ! -iname "981fc740-8bf0-012f-2d2b-52540002105a" ! -iname "e268a4d0-95f6-012f-c815-52540002105a" ! -iname "a6e42e40-66fc-012f-f998-525400977599" \) -execdir rm -rfv {} + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Don't use FFmpeg for metadata extraction. Use FFprobe. | |
# Its output is geared toward parsabilty. | |
# Container and stream information in JSON format: | |
ffprobe -show_format -print_format json 'Serenity - HD Trailer.mp4' | |
ffprobe -show_streams -print_format json 'Serenity - HD Trailer.mp4' | |
# Human-readable values: | |
ffprobe -show_format -pretty -print_format json 'Serenity - HD Trailer.mp4' | |
# Trim video to first 30 seconds, without transcoding. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# tc uses the following units when passed as a parameter. | |
# kbps: Kilobytes per second | |
# mbps: Megabytes per second | |
# kbit: Kilobits per second | |
# mbit: Megabits per second | |
# bps: Bytes per second | |
# Amounts of data can be specified in: | |
# kb or k: Kilobytes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Author: Russ Brooks, TelVue Corporation (www.telvue.com) | |
# Description: Migrates GitHub Issues to Pivotal Tracker. | |
# Dependencies: Ruby 1.9.2+ | |
# GitHub API gem: https://github.com/peter-murach/github | |
# Pivtal Tracker gem: https://github.com/jsmestad/pivotal-tracker | |
# 1. Change the constants below accordingly for your project. | |
# 2. Change the options in list_repo() method for your GitHub project. | |
# 3. Change the options in stories.create() method accordingly. |