Skip to content

Instantly share code, notes, and snippets.

View RyanParsley's full-sized avatar

Ryan Parsley RyanParsley

View GitHub Profile
@RyanParsley
RyanParsley / viewport
Created February 21, 2011 01:02
An approach to a mobile optimized viewport tag
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, target-densityDpi=device-dpi"/>
@RyanParsley
RyanParsley / fancyButton.xml
Created August 22, 2012 19:05
Android native button that resizes with texture, border and drop shadow
<layer-list>
<item>
<nine-patch android:src="@drawable/shadow_button" />
</item>
<item android:top="4dp" android:bottom="6dp" android:left="4dp" android:right="6dp">
<shape android:shape="rectangle">
<solid android:color="#86B9CC" />
<corners android:radius="3dp" />
</shape>
</item>
body{
foo: bar;
}
@RyanParsley
RyanParsley / musicScale.coffee
Created January 2, 2013 16:20
Tinkering around with CoffeeScript, I made a tool that takes a note to use as the root and gives you the rest of the notes in the minor blues scale.
numeralFlat=["I","IIb","II","IIIb","III","IV","Vb","V","VIb","VI","VIIb","VII"]
numeralSharp=["I","I#","II","II#","III","IV","IV#","V","V#","VI","VI#","VII"]
flat=["Ab","A","Bb","B","C","Db","D","Eb","E","F","Gb","G"]
sharp=["G#","A","A#","B","C","C#","D","D#","E","F","F#","G"]
bluesScaleMinor = (root, display = "flat") ->
if display is "flat" or "sharp"
rootIndex = flat.indexOf(root)
else
rootIndex = 0
@RyanParsley
RyanParsley / docToHTML.sh
Last active December 15, 2015 10:39
Run through a web app that removes word junk.
#!/bin/sh
input="$1"
# %%.* strips off everything after the first . in this string
filename="${input%%.*}"
textutil -convert html "$input" -output "$filename".html
curl -d html="$filename".html http://wordoff.org/api/clean
pandoc -f html -t markdown "$filename".html -o "$filename".markdown
@RyanParsley
RyanParsley / GeekTool todo.txt line
Created April 2, 2013 15:14
GeekTool command to display todo.txt
/usr/local/Cellar/todo-txt/2.9/bin/todo.sh -d /Users/ryan/todo.cfg ls
#!/usr/bin/env ruby
Kernel.exec("cd #{File.dirname(__FILE__)} && middleman build")
@RyanParsley
RyanParsley / Format html in Vim.
Created June 5, 2013 18:39
Run these to format html when it comes to me as a single line.
:s/<[^>]*>/\r&\r/g
:g/^$/d
@RyanParsley
RyanParsley / middlemanAnvilConfiguration
Last active December 19, 2015 21:39
Create a new Middleman project and make it work with Anvil.
middleman init my_new_project --rack
rvm --create --ruby-version use 1.9.3
rvm env . -- --env > .powenv
@RyanParsley
RyanParsley / Music numeral cheat sheet
Created August 3, 2013 12:18
Music numeral cheat sheet
0 1 2 3 4 5 6 7 8 9 10 11
------------------------------------------------------------
I IIb II IIIb III IV Vb V VIb VI VIIb VII
------------------------------------------------------------
Ab A Bb B C Db D Eb E F Gb G
A Bb B C Db D Eb E F Gb G Ab
Bb B C Db D Eb E F Gb G Ab A
B C Db D Eb E F Gb G Ab A Bb
C Db D Eb E F Gb G Ab A Bb B
Db D Eb E F Gb G Ab A Bb B C