Skip to content

Instantly share code, notes, and snippets.

def shipping_country_name
shipping_address.try(:country).try(:name)
end
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset=utf-8 />
<title>WebP Demo</title>
<script src="weppy.js"></script>
</head>
<body>
<h1>WebP Demo</h1>
<img src="mandelbrot.webp" width="500">
#######################
#### DOCUMENTATION ####
#######################
#
# Run as:
#
# ruby phonegap-sc.rb APP_NAME
# ruby phonegap-sc.rb APP_NAME PROJECT_PATH
# ruby phonegap-sc.rb APP_NAME PROJECT_PATH OUTPUT_PATH
#
@bebraw
bebraw / gameengines.md
Created January 6, 2011 18:07
List of JS game engines. You can find a wikified version at https://github.com/bebraw/jswiki/wiki/Game-Engines. Feel free to modify that. I sync it here every once in a while.

IMPORTANT! Remember to check out the wiki page at https://github.com/bebraw/jswiki/wiki/Game-Engines for the most up to date version. There's also a "notes" column in the table but it simply does not fit there... Check out the raw version to see it.

This table contains primarily HTML5 based game engines and frameworks. You might also want to check out the [[Feature Matrix|Game-Engine-Feature-Matrix]], [[Game Resources]] and [[Scene Graphs]].

Name Size (KB) License Type Unit Tests Docs Repository Notes
Akihabara 453 GPL2, MIT Classic Repro no API github Intended for making classic arcade-style games in JS+HTML5
AllBinary Platform Platform Dependent AllBinary 2D/2.5D/3D n
@jessedc
jessedc / iOS Icon.png bash script
Last active February 25, 2018 03:02
A simple bash script using OSX command line tool sips to resample a 1024x1024 image
#!/bin/bash
f=$(pwd)
sips --resampleWidth 512 "${f}/${1}" --out "${f}/iTunesArtwork"
sips --resampleWidth 1024 "${f}/${1}" --out "${f}/iTunesArtwork@2x"
sips --resampleWidth 57 "${f}/${1}" --out "${f}/Icon.png"
sips --resampleWidth 114 "${f}/${1}" --out "${f}/[email protected]"
sips --resampleWidth 29 "${f}/${1}" --out "${f}/Icon-Small.png"
sips --resampleWidth 58 "${f}/${1}" --out "${f}/[email protected]"
sips --resampleWidth 50 "${f}/${1}" --out "${f}/Icon-Small-50.png"
@petergerard
petergerard / watermark.rb
Created February 25, 2011 05:50
paperclip_processor for watermarking that works with rails 3 and paperclip 2.3.8
# from http://github.com/ng/paperclip-watermarking-app
# with modifications from http://exviva.posterous.com/watermarking-images-with-rails-3-and-papercli
# and even more modifications to ensure works with paperclip 2.3.8 and rails 3.0.3
#
# Note: In rails 3 paperclip processors are not automatically loaded.
# You must add the following above your model class definition:
#
# require 'paperclip_processors/watermark'
module Paperclip
@topherfangio
topherfangio / test.handlebars
Created March 3, 2011 14:37
TemplateView with Handlebars
<h1>Test Handlebars Page</h1>
<p>
I really like {{ somevar }}!
</p>
@voldy
voldy / deploy.rb
Created March 3, 2011 23:53 — forked from kpumuk/deploy.rb
namespace :deploy do
desc 'Bundle and minify the JS and CSS files'
task :precache_assets, :roles => :app do
root_path = File.expand_path(File.dirname(__FILE__) + '/..')
jammit_path = Dir["#{root_path}/vendor/gems/jammit-*/bin/jammit"].first
yui_lib_path = Dir["#{root_path}/vendor/gems/yui-compressor-*/lib"].first
assets_path = "#{root_path}/public/assets"
# Precaching assets
run_locally "ruby -I#{yui_lib_path} #{jammit_path}"
@necolas
necolas / contain-floats.css
Created April 22, 2011 00:36
Cross-browser, consistent float-containment methods
/*
* Containing floats in a consistent manner
* By Jonathan Neal and Nicolas Gallagher
*/
/*
* New block formatting context method
* IE 6+, Firefox 2+, Safari 4+, Opera 9+, Chrome
*/
@naneau
naneau / font.coffee
Created May 7, 2011 15:56
Load google web fonts, in CoffeeScript! :)
# Export Google WebFont Config
window.WebFontConfig =
# Load some fonts from google
google:
families: ['Inconsolata', 'Pacifico', 'Droid Sans', 'Droid Serif']
# ... you can do something here if you'd like
active: () ->
# Create script tag matching protocol