Skip to content

Instantly share code, notes, and snippets.

View andynu's full-sized avatar

Andrew Nutter-Upham andynu

View GitHub Profile
@andynu
andynu / generate_glyphicons_pro_css.rb
Created May 14, 2012 15:28
Generate css for Glyphicons Pro.
#!/usr/bin/env ruby
#
# Generate css for the pro glyphicons.
# Run this script in the glyphicons_pro/glyphicons/png folder
# from the purchased zip file.
#
# see http://glyphicons.com/ for purchase/license information.
#
render = (ARGV.include? "--html") ? :html : :css
@andynu
andynu / ytget.py
Created January 3, 2013 21:56
Search youtube. Download the first page of videos. Convert to mp3s. requires curl, youtubedown, and soundconverter
#!/usr/bin/env python
from subprocess import check_output, CalledProcessError, call
import re
import glob
# Search youtube
search_term = 'Chordettes'
youtube_search_url = 'https://www.youtube.com/results?search_query=' + search_term
youtube_search_results = check_output(["curl", youtube_search_url])
@andynu
andynu / Spirograph-v2.markdown
Created January 27, 2014 23:27
A Pen by Andrew Nutter-Upham.

Spirograph v2

A Spirograph is a geometric drawing toy that produces mathematical roulette curves of the variety technically known as hypotrochoids and epitrochoids. It was developed by British engineer Denys Fisher and first sold in 1965.

"Spirograph" has also been used to describe a variety of software applications that display similar curves. It has also been applied to the class of curves that can be produced with the drawing equipment, and therefore may be regarded as a synonym of hypotrochoid. The name has been a registered trademark of Hasbro, Inc., since it bought the Denys Fisher company.

A Pen by Andrew Nutter-Upham on CodePen.

License.

@andynu
andynu / hourly.json
Created November 30, 2015 20:05
Parsing JSON Issue
{
"response": {
"version":"0.1",
"termsofService":"http://www.wunderground.com/weather/api/d/terms.html",
"features": {
"hourly": 1
}
}
,
"hourly_forecast": [
{
"response": {
"version":"0.1",
"termsofService":"http://www.wunderground.com/weather/api/d/terms.html",
"features": {
"hourly": 1
}
}
,
@andynu
andynu / encoding_discovery.rb
Created August 24, 2016 18:14
Encoding error details
str = "ó bhí mé óg, thaitin leabhair liom"
bytes = str.bytes
targets = ["贸","铆","茅","贸"].uniq
p :original, str
w = str.force_encoding('ISO-8859-1')
#p :iso88591, w
#p :utf8,w.encode("UTF-8")
@andynu
andynu / Editor Bug
Last active June 19, 2017 23:28
Standard Notes: Editor Plus Icons Bug
The icons are all squares.
@andynu
andynu / controller_snippet.rb
Created January 29, 2021 20:16
Generic rails model filtering
def index
@records = Record.filter_params(params[:filters])
end
@andynu
andynu / rfluff
Last active February 2, 2021 17:27
Find all those TODO/FIXME/HACK/etc.
#!/usr/bin/ruby
#
# gather a few statistics and find all flagged comments
#
# Usage:
# rfluff [-qf] [tag] [tag] ...
#
# -qf outputs a vim compatible quickfix format, otherwise
# the output is human readable
@andynu
andynu / examples.sh
Created November 5, 2021 16:39
gem-versions
# Presumes your projects are in subdirectories of the current directory
./gem-versions.rb rails # Show you what rails versions are used across your projects, noting the latest
./gem-versions.rb --outdated # show you all the outdated gems across all your projects