Skip to content

Instantly share code, notes, and snippets.

View zapatoche's full-sized avatar

Yannick Schall zapatoche

  • Bish Bash Bosh it
  • London, UK
View GitHub Profile
@zapatoche
zapatoche / convert-number-to-word.rb
Created May 21, 2012 17:57 — forked from bzerangue/convert-number-to-word.rb
Convert Number to Word - Sass Function
require 'sass'
## install Linguistics gem, sudo install gem linguistics
require 'linguistics'
Linguistics::use( :en ) # extends Array, String, and Numeric
## this is the linguistics gem,
## instructions on how to use, http://deveiate.org/projects/Linguistics/wiki/English
## 5.en.numwords would output 'five'
@zapatoche
zapatoche / _media-queries.scss
Created May 14, 2012 18:20 — forked from anthonyshort/_media-queries.scss
Media Queries in Sass
// Media Queries in Sass 3.2
//
// These mixins make media queries a breeze with Sass.
// The media queries from mobile up until desktop all
// trigger at different points along the way
//
// And important point to remember is that and width
// over the portrait width is considered to be part of the
// landscape width. This allows us to capture widths of devices
// that might not fit the dimensions exactly. This means the break
@zapatoche
zapatoche / friendly_urls.markdown
Created April 23, 2012 13:14 — forked from cdmwebs/friendly_urls.markdown
Friendly URLs in Rails

Friendly URLs

By default, Rails applications build URLs based on the primary key -- the id column from the database. Imagine we have a Person model and associated controller. We have a person record for Bob Martin that has id number 6. The URL for his show page would be:

/people/6

But, for aesthetic or SEO purposes, we want Bob's name in the URL. The last segment, the 6 here, is called the "slug". Let's look at a few ways to implement better slugs.

@zapatoche
zapatoche / install.sh
Created April 21, 2012 11:38 — forked from cloud8421/install.sh
Install tmux 1.6 on Ubuntu 10.04
wget -q -O - https://raw.github.com/gist/2204072/install_tmux_1.6_on_ubuntu_10.04.sh | sudo bash
@zapatoche
zapatoche / dabblet.css
Created April 17, 2012 09:41 — forked from LeaVerou/dabblet.css
Vertical centering with Flexbox + margin fallback
/**
* Vertical centering with Flexbox + margin fallback
* Lea Verou & David Storey
*/
html, body { height: 100%; }
body {
width: 100%; /* needed for FF */
margin: 0;
@zapatoche
zapatoche / install.sh
Created April 2, 2012 20:05 — forked from cloud8421/install.sh
Install tmux 1.6 on Ubuntu 10.04
wget -q -O - https://raw.github.com/gist/2204072/install_tmux_1.6_on_ubuntu_10.04.sh | sudo bash
@zapatoche
zapatoche / responsive-context-images.html
Created March 16, 2012 15:32 — forked from vasilisvg/responsive-context-images.html
Responsive context aware images without cookies or server logic
<!doctype html>
<meta charset="UTF-8">
<title>Client side context aware responsive images</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.image-container {
width: 50%;
position: relative;
}
.image-container img {
@zapatoche
zapatoche / dabblet.css
Created February 23, 2012 11:26 — forked from alexmwalker/dabblet.css
CSS3 Animated Flame *
/**
* CSS3 Animated Flame *
*/
body {background-color:#000}
#logfire {
position:relative;
background:url(http://sitepointstatic.com/examples/css3/animation/logfire.jpg?r=2) center top no-repeat;
height:400px;
margin-top:100px
@zapatoche
zapatoche / yannick@handydandies.com
Created January 31, 2012 00:24
yannick@handydandies.com
2012-01-31T00:07:15+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/mongoid-2.4.3/lib/mongoid/config/database.rb:22:in `configure'
2012-01-31T00:07:15+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/mongoid-2.4.3/lib/mongoid/config.rb:273:in `configure_databases'
2012-01-31T00:07:15+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/mongoid-2.4.3/lib/mongoid/config.rb:94:in `from_hash'
2012-01-31T00:07:15+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/mongoid-2.4.3/lib/mongoid/config.rb:109:in `block in load!'
2012-01-31T00:07:15+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/mongoid-2.4.3/lib/mongoid/config.rb:108:in `tap'
2012-01-31T00:07:15+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/mongoid-2.4.3/lib/mongoid/config.rb:108:in `load!'
2012-01-31T00:07:15+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/mongoid-2.4.3/lib/mongoid.rb:147:in `load!'
2012-01-31T00:07:15+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railti
@zapatoche
zapatoche / gist:1700231
Created January 29, 2012 19:19
heroku logs
➜ salsacaribecouk git:(mongo-proto) heroku logs
2012-01-29T19:13:46+00:00 app[web.1]: s.summary = %q{Object-relational mapper framework (part of Rails).}
2012-01-29T19:13:46+00:00 app[web.1]:
2012-01-29T19:13:46+00:00 app[web.1]: if s.respond_to? :specification_version then
2012-01-29T19:13:46+00:00 app[web.1]: current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
2012-01-29T19:13:46+00:00 app[web.1]:
2012-01-29T19:13:46+00:00 app[web.1]: if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
2012-01-29T19:13:46+00:00 app[web.1]: s.add_runtime_dependency(%q<activesupport>, ["#<Syck::DefaultKey:0x00000008daf478> 3.2.0"])
2012-01-29T19:13:46+00:00 app[web.1]: s.add_runtime_dependency(%q<activemodel>, ["#<Syck::DefaultKey:0x00000008dad470> 3.2.0"])
2012-01-29T19:13:46+00:00 app[web.1]: s.add_runtime_dependency(%q<arel>, ["~> 3.0.0"])