Skip to content

Instantly share code, notes, and snippets.

View linojon's full-sized avatar

Jonathan Linowes linojon

View GitHub Profile
EXAMPLE 5
<% semantic_form_for @info, :renderer => :erb do |f| %>
<% f.inputs do %>
<% f.inputs :structure => :inline do %>
<%= f.input :first %>
<%= f.input :middle %>
<%= f.input :last %>
<%= f.buttons %>
<% end %>
<% end %>
# Is this a bug in rails? time conversion to xml and json ends in Z not %Z ?
irb(main):018:0> t = Time.zone.now
=> Wed, 10 Aug 2011 17:38:45 UTC +00:00
irb(main):019:0> t.to_json
=> "\"2011-08-10T17:38:45Z\""
irb(main):020:0> t.xmlschema
=> "2011-08-10T17:38:45Z"
irb(main):021:0> t.strftime("%Y-%m-%dT%H:%M:%S%Z")
=> "2011-08-10T17:38:45UTC"
@linojon
linojon / rails31init.md
Created September 10, 2011 02:20 — forked from docwhat/rails31init.md
Rails 3.1 with Rspec, Factory Girl, Haml, Simple Form, Devise, CanCan, Nifty, Database Cleaner, Spork, and Guard

Install Rails 3.1

gem install rails

generate new app, skipping Test::Unit file generation

rails new my_app -T

Set up Gemfile

// app/assets/javascripts/myapp/controllers.js
function PostListCtrl($scope) {
$scope.posts = [
{ "title": "My First Post", "intro": "Subtitle of my post" },
{ "title": "Another Post", "intro": "Something interesting about this post" },
{ "title": "One More Thng", "intro": "There's always something more" }
]
}
// html contains <div ng-app="myapp">
module DropInTheBucket
class File < ::ActiveRecord::Base
belongs_to :dropinable, polymorphic: true
mount_uploader :item, PhotoUploader
end
end
---
class Note < ActiveRecord::Base
@linojon
linojon / .gitignore
Created October 4, 2015 21:58 — forked from thebeardphantom/.gitignore
Unity GitIgnore
# Ignore everything
/*
/*/
# Inverse ignore some stuff
!/Assets/
!/ProjectSettings/
!.gitignore
# OS Stuff
@linojon
linojon / parkerhill-unity.gitignore
Last active December 12, 2024 04:02
parkerhill-unity.gitignore
# This .gitignore file should be placed at the root of your Unity project directory
# First part from https://github.com/github/gitignore/blob/master/Unity.gitignore
# Parkerhill additions at the end
/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/[Ll]ogs/
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain