Skip to content

Instantly share code, notes, and snippets.

@whophil
whophil / .gitignore
Created February 21, 2016 17:38 — forked from k0d3r/gist:3118874
.gitignore for OS (Windows/Mac) generated files
# Windows
Thumbs.db
desktop.ini
# OS X
.DS_Store
.Spotlight-V100
.Trashes
._*
@LeeMendelowitz
LeeMendelowitz / DC_Metrorail_Ridership.mac.csv
Last active May 1, 2021 18:12
Replace "^M" carriage return control character with newline
We can make this file beautiful and searchable if this error is corrected: It looks like row 71 should actually have 2 columns, instead of 1 in line 70.
Date,Total1/1/04,1290001/2/04,4190001/3/04,2220001/4/04,1400001/5/04,5640001/6/04,6090001/7/04,6090001/8/04,6110001/9/04,6240001/10/04,2010001/11/04,1350001/12/04,6180001/13/04,6600001/14/04,6610001/15/04,6280001/16/04,5940001/17/04,2360001/18/04,1480001/19/04,2200001/20/04,6170001/21/04,6470001/22/04,6870001/23/04,6400001/24/04,2210001/25/04,1360001/26/04,4360001/27/04,5170001/28/04,6140001/29/04,6550001/30/04,6330001/31/04,2150002/1/04,1340002/2/04,6150002/3/04,5980002/4/04,6590002/5/04,6520002/6/04,6030002/7/04,2380002/8/04,1410002/9/04,6210002/10/04,6500002/11/04,6600002/12/04,6510002/13/04,6440002/14/04,2730002/15/04,1680002/16/04,2410002/17/04,6340002/18/04,6480002/19/04,6650002/20/04,6640002/21/04,2580002/22/04,1450002/23/04,6220002/24/04,6460002/25/04,6570002/26/04,6530002/27/04,6380002/28/04,2510002/29/04,1510003/1/04,6190003/2/04,6470003/3/04,6600003/4/04,6630003/5/04,6600003/6/04,2530003/7/04,1720003/8/04,6300003/9/04,6610003/10/
@hofmannsven
hofmannsven / README.md
Last active February 24, 2026 15:26
Raspberry Pi Cheatsheet
@bluemont
bluemont / url_validator.rb
Created June 25, 2012 04:27
ActiveModel URL Validator
class UrlValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
valid = begin
URI.parse(value).kind_of?(URI::HTTP)
rescue URI::InvalidURIError
false
end
unless valid
record.errors[attribute] << (options[:message] || "is an invalid URL")
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream