This file contains 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
# Author Gregg Lind | |
# License: Public Domain. I would love to hear about any projects you use if it for though! | |
# Original location: http://writeonly.wordpress.com/2009/03/20/adjacency-list-of-states-of-the-united-states-us/ | |
AK | |
AL,MS,TN,GA,FL | |
AR,MO,TN,MS,LA,TX,OK | |
AZ,CA,NV,UT,CO,NM | |
CA,OR,NV,AZ | |
CO,WY,NE,KS,OK,NM,AZ,UT |
This file contains 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 | |
require 'shellwords' | |
files = `find . -iname '*.heic'`.split("\n") | |
files.each do |original_file| | |
output_file = original_file.gsub(/\.heic\z/i, ' Converted.jpg') | |
if File.exist?(output_file) | |
STDERR.puts "Skipping output #{output_file} exists." | |
else |
This file contains 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/sh | |
head -n 4096 /dev/urandom | openssl sha1 |
This file contains 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
These original sources are now no longer available: | |
- http://www.xent.com/FoRK-archive/oct00/0429.html | |
- http://www.cryptorights.org/events/2000/superpolynomial.html | |
For a 2000 example of how to use this song in a lecture format, see http://permalink.gmane.org/gmane.comp.encryption.general/4856 by Eric Hughes. | |
To the tune of Mary Poppins: | |
Superpolynomial subexponential runtimes. | |
Even though in practice it would take you several lifetimes, |
This file contains 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 | |
# Find all the directories with a docker-compose.yml file and stop the services. | |
# | |
# Place this file in your path, such as ~/bin/fullstop and chmod 755. | |
DOCKER_COMPOSE_COMMAND = 'docker-compose'.freeze | |
files = `locate docker-compose.yml`.split | |
files.each do |docker_compose_file| | |
next unless File.basename(docker_compose_file) == 'docker-compose.yml' | |
parent_directory = File.dirname(docker_compose_file) |
This file contains 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
# Thanks to http://dev.enekoalonso.com/2011/08/09/uninstalling-brew-so-i-can-reinstall/ | |
cd `brew --prefix` | |
rm -rf Cellar | |
brew prune | |
rm -rf Library .git .gitignore bin/brew README.md share/man/man1/brew | |
rm -rf ~/Library/Caches/Homebrew | |
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" |
This file contains 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
# frozen_string_literal: true | |
## | |
# Primary responsibility is extracting text from a PDF or confirming if | |
# text is available in the PDF. | |
# | |
# Security note: This simple wrapper assumes that the PDF filename that you give it has been | |
# chosen by an internal method, such as a tempfile name. Do not pass unsafe user supplied file names | |
# into this class. | |
# |
This file contains 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
# | |
# PostgreSQL writes two optional commands to the database schema | |
# file, called db/structure.sql, that can only be run as a root | |
# database user. These are not needed actually, so comment them | |
# out automatically | |
# | |
# CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog; | |
# COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language'; | |
# | |
namespace :db do |
This file contains 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 | |
# frozen_string_literal: true | |
# Convert new American Express QFX files (since June 2020) to older SGML format | |
# that GnuCash can import. | |
require 'nokogiri' | |
def show_usage | |
warn 'Usage: amex-ofx-downgrader.rb /path/to/source/file.qfx /path/to/output.qfx' |
This file contains 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
namespace :db do | |
desc "Update and create SQL views" | |
task :views => :environment do | |
Dir["#{Rails.root}/db/sql_views/*.sql"].each do |file_name| | |
STDERR.puts "Applying the SQL view at #{file_name}" | |
source_file = File.new(file_name, 'r') | |
if source_file and (sql_content = source_file.read) | |
ActiveRecord::Base.transaction do | |
# Each statement ends with a semicolon followed by a newline. |
NewerOlder