This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% if target.errors.any? %> | |
<div class="error_explanation"> | |
<h2><%= pluralize(target.errors.count, "error") %> prevented this record from being saved:</h2> | |
<ul> | |
<% target.errors.full_messages.each do |msg| %> | |
<li><%= msg %></li> | |
<% end %> | |
</ul> | |
</div> | |
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User | |
has_attached_file :photo, | |
:processors => [:watermark], | |
:styles => { | |
:medium => { | |
:geometry => "300x300>", | |
:watermark_path => "#{Rails.root}/public/images/watermark.png" | |
}, | |
:thumb => "100x100>", | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function lock_scroll(){ | |
// lock scroll position, but retain settings for later | |
var scrollPosition = [ | |
self.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft, | |
self.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop | |
]; | |
var html = jQuery('html'); // it would make more sense to apply this to body, but IE7 won't have that | |
html.data('scroll-position', scrollPosition); | |
html.data('previous-overflow', html.css('overflow')); | |
html.css('overflow', 'hidden'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Object Literal | |
var app = app || {}; | |
//object literal | |
app = { | |
init: function(){ | |
this.cache(); | |
this.bind(); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*jslint nomen: true */ | |
window.App = window.App || {}; | |
window.App.ModuleName = (function (document, $) { | |
'use strict'; //OPTIONAL if you don't want your code to be strict | |
var _vars, _els, _privateMethod, init; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'active_record' | |
class Color < ActiveRecord::Base | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#input').on('keyup', function() { | |
// do an ajax save when this input is changed | |
var val = this.value; | |
// clear the timeout so we dont fire in succession | |
clearTimeout(this.delayer); | |
this.delayer = setTimeout(function () { | |
console.log(val); | |
}, 500); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@font-face { font-family: 'Glyphicons files'; src: url('../fonts/glyphicons-filetypes-regular.eot'); src: url('../fonts/glyphicons-filetypes-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-filetypes-regular.woff') format('woff'), url('../fonts/glyphicons-filetypes-regular.ttf') format('truetype'), url('../fonts/glyphicons-filetypes-regular.svg#glyphicons-filetypes-regular') format('svg'); } .glyphfiles { position: relative; top: 1px; display: inline-block; font-family: 'Glyphicons files'; font-style: normal; font-weight: normal; line-height: 1; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }.glyphfiles-txt:before {content: "\e001"; }.glyphfiles-doc:before {content: "\e002"; }.glyphfiles-rtf:before {content: "\e003"; }.glyphfiles-log:before {content: "\e004"; }.glyphfiles-tex:before {content: "\e005"; }.glyphfiles-msg:before {content: "\e006"; }.glyphfiles-text:before {content: "\e007"; }.glyphfiles-wpd:before {content: "\e008"; }.glyphfiles-wps:before {con |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// <button> reset | |
// | |
// 1. Remove default browser appearance for buttons. | |
// 2. Remove margins. | |
// 3. Remove borders for IE. | |
// 4. Normalize font and color not inherited by `button`. | |
// 5. Address `overflow` in IE | |
// 6. Normalize cursor style |
OlderNewer