Skip to content

Instantly share code, notes, and snippets.

View hmans's full-sized avatar
🚀
Let's go!

Hendrik Mans hmans

🚀
Let's go!
View GitHub Profile
@hmans
hmans / gist:2858354
Created June 2, 2012 13:15
Format currency values.
# So I wrote this cute little currency view formatting helper. Enjoy.
#
# (On a side note, shortly after writing this, I decided to use the awesome
# Money gem in my project, rendering most of this code obsolete.)
#
def currency(v, options = {})
options = {
:symbol => "€",
:separator => ".",
:decimal_separator => ",",
@hmans
hmans / gist:2816142
Created May 27, 2012 22:17
Test your code against all installed Ruby versions (using rbfu)
for ruby in $HOME/.rbfu/rubies/*; do rbfu @${ruby##*/} bundle && bundle exec rake ; done
@hmans
hmans / config.ru
Created May 6, 2012 14:08
More work in progress...
run Freddie do
layout 'application.html.haml'
# Serve some asset files
#
path('application-:timestamp.css') { stylesheet 'application.scss' }
path('application-:timestamp.js') { javascript 'application.js' }
# Built-in OmniAuth support
#
app = Freddie do
path 'one' do
render "1"
path 'two' do
render "2"
path 'three' do
render "3!"
end
@hmans
hmans / config.ru
Created May 4, 2012 18:19
Freddie objects!
run Freddie(:redirect, '/events') do
layout 'application'
child 'events', Freddie(:resource, Event) # full Rails-style RESTful web resource. :)
child 'application.css', Freddie(:stylesheet, 'application.css.scss')
child 'application.js', Freddie(:static, 'views/application.js', content_type: 'text/javascript')
end
@hmans
hmans / app.rb
Created May 1, 2012 00:59
Work in progress...
require 'freddie'
class Event
include Mongoid::Document
# ...
end
class App < Freddie::App
resource :events do
permit do |user|
@hmans
hmans / manifesto-manifesto.md
Created April 24, 2012 12:57
The Manifesto Manifesto
@hmans
hmans / whatever-manifesto.md
Created April 23, 2012 16:30
The Whatever Manifesto

THE WHATEVER MANIFESTO

  1. Follow your dreams (or don't. Whatever.)
  2. Work sane hours (or don't. Whatever.)
  3. Separate work from life (or don't. Whatever.)
  4. Build a fun side project (or don't. Whatever.)
  5. Always be open to new ideas (or don't. Whatever.)
  6. Learn how to manage your money (or don't. Whatever.)

Whatever it is that you choose to do, follow these two simple rules:

@hmans
hmans / theme.scss
Created April 12, 2012 18:52
Schnitzelpress 0.3.0 Theme SCSS Preview
@import 'schnitzelstyle';
@include grid;
@include buttons;
/* variables! */
$font: 15px "Helvetica Neue",Arial,Helvetica,sans-serif;
$font-title: 15px Verdana,Arial,Helvetica,sans-serif;
$font-monospaced: 13px Menlo,Monaco,"Lucida Console",monospace;
$color-background: #fff;
@hmans
hmans / gist:2360309
Created April 11, 2012 16:17
Schnitzelpress default template
<!DOCTYPE html>
<html>
<head>
<title>
{% if single_post %}{{ single_post.title }} |{% endif %}
{{ blog.title }}
</title>
<meta content='text/html; charset=UTF-8' http-equiv='content-type' />
<meta content='width=device-width, initial-scale=1.0' name='viewport' />
<link href='/assets/schnitzelpress.1332747656.css' media='screen' rel='stylesheet' type='text/css' />