Skip to content

Instantly share code, notes, and snippets.

View tspangler's full-sized avatar
💵
if i'm goin down then i'm goin down rich

Timothy tspangler

💵
if i'm goin down then i'm goin down rich
View GitHub Profile
@tspangler
tspangler / dl-hashes.rb
Created May 30, 2021 14:46
Download all hashes from virusshare.com
#!/usr/bin/env ruby
BASE_URL = "https://virusshare.com/hashfiles/VirusShare_00!.md5"
0..389.each do |num|
puts "Downloading #{num}..."
`wget #{BASE_URL.gsub('!', num)}`
end
@tspangler
tspangler / validation.js
Created October 25, 2019 15:11
Various validation regexes
// Assorted validation regexes from Nicor's rebate system
{
USERNAME_REGEX : /^[a-zA-Z0-9_\-]{0,1000}$/,
PASSWORD_REGEX : /^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[^a-zA-Z0-9])[A-Za-z0-9~`!@#$%^&*()_+={}\-]{8,50}$/,
MTN_REGEX : /^\d{10}$/,
TRACKING_NO_REGEX : /^\d{5,13}$/,
ZIPCODE5_REGEX : /^\d{5}$/,
ACCOUNT_REGEX : /^\d{10}$/,
ACCOUNT_REGEX_20: /^\d{0,20}$/,
NUMBER_REGEX : /^\d*$/,
@tspangler
tspangler / crush.sh
Last active October 25, 2019 15:13
max pngcrush + base64 + strip newlines + copy to clipboard
pngcrush -rem allb -brute -reduce file.png /dev/stdout | openssl base64 | tr -d '\n' | pbcopy
@tspangler
tspangler / airlines.json
Created May 15, 2019 18:11
Airlines with ICAO code and country of origin
[{
"icao": "EVY",
"carrier": "34 Squadron, Royal Australian Air Force",
"country": "Australia"
}, {
"icao": "RNX",
"carrier": "1Time Airline",
"country": "South Africa"
}, {
"icao": "TTF",
@tspangler
tspangler / gsp.svg
Last active December 10, 2018 19:10
Garden State Parkway shield
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tspangler
tspangler / maximize.rb
Created October 22, 2018 19:08
Look for a window and maximize it when found
# `gem install win32-window` first
require 'win32/window'
puts "Searching for Notepad window..."
window = nil
loop do
window = Window.find(title: /Notepad/)
break unless window.empty?
@tspangler
tspangler / gist:bca7457f70cde9257042409691fcd1f0
Created December 29, 2017 19:16
Extract gem names from `Gemfile`
Find: gem '(.*?)'(.*)\n?
Replace: \1\n
@tspangler
tspangler / gist:ccf1c56e1f8d1012af76a56ed03225e7
Created December 29, 2017 18:54
Parse output of `bundle outdated`
Find: ^(.+) \(newest ([A-Za-z0-9\s\.]+), installed ([0-9\.]+).*\n
Replace: \1,\2,\3\n
This will take the output of `bundle outdated` and create a comma-delimited list in this format:
`gem_name,bundle_version,newest_version`
@tspangler
tspangler / gist:4485306
Created January 8, 2013 16:39
Convert ugly CamelCase model schemas to lcase and underscores. Input: User(id: integer, FirstName: string, LastName: string, StreetAddress: string, City: string, State: string, Zip: string, PhoneNumber: string, EmailAddress: string, created_at: datetime, updated_at: datetime) Output: rails g scaffold User id:integer first_name:string last_name:s…
# encoding: utf-8
puts 'What should I name the model?'
model_name = gets
puts 'Enter model schema:'
sch = gets.match(/\((.*)\)/)[1]
puts 'Analyzing schema string...'
scaffold_string = 'rails g scaffold {replace_me}'
@tspangler
tspangler / gist:1612731
Created January 14, 2012 20:15
#VegasTech's message to our representatives
NOTES
- The immediate threat seems to be PIPA in the senate, and since we're constituents of the most influential man in the senate, we'll start with Reid.
- What about Dean Heller?
- SOPA is just as bad. We have to talk to Shelley Berkley too.
- Amending the bill to take out the DNS blocking provisions isn't good enough.