Skip to content

Instantly share code, notes, and snippets.

View acconrad's full-sized avatar
🤓
VR to the moon

Adam Conrad acconrad

🤓
VR to the moon
View GitHub Profile
@acconrad
acconrad / _review_form.html.erb
Created January 8, 2011 04:58
Page for reviews
<%= form_for @review do |f| %>
<div class="field">
<%= f.label :review_text, "Review:" %><br />
<%= f.text_area :review_text %>
...rest of code ignore...
contents = Content.search('hello world') #returns array, Content has page_id, value, value_type
@pages = Page.all(:conditions => {:page_id = contents.page_id} , :order => :overall_rating)
class User < ActiveRecord::Base
has_many :widgets
end
def index
if @company
@locations = @company.locations
@sectors = @company.sectors
@openings = @company.openings
@reviews = Review.where(:company_id => @company.id)
end
@review = Review.new
end
- @my_list.each do |item|
= link_to item.name
- unless item == @my_list.last
,
# how do I comma separate so that there isn't a space after the item?
@acconrad
acconrad / html5.haml
Created April 26, 2012 20:39 — forked from fnhipster/html5.haml
HTML5 HAML Template
!!!
%title= "Your Website"
%meta{ :charset => "utf-8" }
%meta{ :http-equiv="X-UA-Compatible" :content => "IE=edge,chrome=1" }
%meta{ :content => "", :name => "description" }
%meta{ :content => "", :name => "author" }
%link{ :href => "/css/style.css", :rel => "stylesheet" }
%header
%nav
%ul
@acconrad
acconrad / style.css
Created May 9, 2012 16:34
iPhone Text Message Screen CSS3
body {
background-color: #dbe2ed;
}
.container {
width: 688px;
margin-left: 1em;
}
.white-shadow {
background-image: -webkit-linear-gradient(top, rgba(255, 255, 255, .8) 4px, rgba(255, 255, 255, .28) 8px);
background-image: -moz-linear-gradient(top, rgba(255, 255, 255, .8) 4px, rgba(255, 255, 255, .28) 8px);
@acconrad
acconrad / gist:3350298
Created August 14, 2012 15:31
How to target mobile devices with CSS Media Queries
@media (max-width: 480px) {
/* Mobile CSS goes here */
}
@acconrad
acconrad / gist:3350416
Created August 14, 2012 15:48
How to target mobile devices with CSS Media Queries
@media only screen and (-webkit-device-pixel-ratio: .75) {
/* CSS for Low-density screens goes here *
* Ex: HTC Evo, HTC Incredible, Nexus One */
}
@media only screen and (-webkit-device-pixel-ratio: 1) and (max-device-width: 768px) {
/* CSS for Medium-density screens goes here *
* Ex: Samsung Ace, Kindle Fire, Macbook Pro *
* max-device-width added so you don't target laptops and desktops */
}
@acconrad
acconrad / init.js
Created August 31, 2012 18:13
Troublesome JS functions
function addDailyPlayer (element) {
if (logged_in) {
var $row = $(element).closest('li')
, $myTeam = $('#player_confirmation_table').children('tbody')
, playerSlotAvailableNew = 0
, useFlex = false
, $playerInfo
, $playerSlot
, playerId
, gameId