Skip to content

Instantly share code, notes, and snippets.

View stefanpenner's full-sized avatar
🎯
Focusing

Stefan Penner stefanpenner

🎯
Focusing
View GitHub Profile
require 'rubygems'
require 'yaml'
=begin
Vhost.yml ( path_to_yml_file ) >> Collection of Vhosts
Vhost.new (params) >> Single Vhost
=end
class Vhost
def self.yml(path)
vhosts = []
#load templates
<td>
<a href="/admin/users/29"><img alt="User" src="/images/user.png?1227591989" /></a>
<b><a href="/admin/users/29">Stefan Penner</a></b>
</td>
#_user.html.haml
%tr{:class => cycle('odd','even')}
%td.text-align-left
=link_to image_tag('user.png'),[:admin,user]
%b=link_to user.name,[:admin,user]
%td.text-align-left=user.email
%td= 'confirmed' if user.confirmed?
%td= link_to 'Edit', edit_admin_user_url(user)
%td= link_to image_tag('icon-remove.gif'), [:admin,user], :confirm => 'Are you sure?', :method => :delete
!!!
%html{ :lang => "en" }
=render :partial => '/layouts/head'
%body
.container
#header= render :partial => '/shared/header'
=render :partial => '/account/menu'
- flash.each do |key, value|
%div{:class => key}= h(value)
#bd= yield
<html>
<head>
<script type="text/javascript" src="jquery-1.2.6.js"></script>
<script type="text/javascript">
// tablelize
(function($){
$.fn.tablize = function(){
var store = new Array();
var toText = function(){ return $(this).text(); };
- fields_for "financial_plan[goal_attributes][]",goal do |form|
- @goal = goal
= error_messages_for :goal
.text_field
= form.label :months
= form.text_field :months, :class => 'text'
.text_field
= form.label :description
= form.text_field :description, :class => 'text'
.text_field
require 'rubygems'
require 'wirble'
require 'fileutils'
# Colorize
Wirble.init
Wirble.colorize
# I use vim
alias q exit
require 'rubygems'
require 'wirble'
require 'fileutils'
# Colorize
Wirble.init
Wirble.colorize
# I use vim
alias q exit
module StefansAssignment
def self.included(base)
base.class_eval do
extend ClassMethods
include InstanceMethods
end
end
module ClassMethods
def model_accesible(*models)