Skip to content

Instantly share code, notes, and snippets.

View trafnar's full-sized avatar

Nathan Manousos trafnar

View GitHub Profile
<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->
# Helper function that returns a number with its correct indefinite article
# e.g. number_with_indefinite_article(10) #=> "a 10"
# e.g. number_with_indefinite_article(80, "$") #=> "an $80"
def number_with_indefinite_article(number, prefix=nil)
[indefinite_article_for_number(number), " ", prefix, number].compact.join
end
# Helper function that returns the correct indefinite article for a number
# e.g. indefinite_article_for_number(10) #=> "a"
# e.g. indefinite_article_for_number(80) #=> "an"
@ukstudio
ukstudio / hello.coffee
Created April 18, 2011 17:28
CoffeeScript+QUnit
hello = -> 'hello'
@jimeh
jimeh / jquery.myplugin.coffee
Created April 7, 2011 23:44
Example jQuery plugin written in CoffeeScript, and the resulting compiled JavaScript file.
$.fn.extend
myplugin: (options) ->
self = $.fn.myplugin
opts = $.extend {}, self.default_options, options
$(this).each (i, el) ->
self.init el, opts
self.log el if opts.log
$.extend $.fn.myplugin,
default_options:
@trafnar
trafnar / gist:367966
Created April 16, 2010 03:21
Examples of common CSS properties and techniques
<style type="text/css" media="screen">
*{margin:0; padding:0;}
h1,h2{margin-bottom:10px; margin-top:30px;}
body{padding:30px;}
</style>
<h1>floats</h1>
<h2>simple left/right</h2>
<style type="text/css" media="screen">
#simple_floats{overflow:auto; border:5px solid #092994; width:500px;}