- Time Picker - https://github.com/trentrichardson/jQuery-Timepicker-Addon
- Chosen Dropdown - http://harvesthq.github.com/chosen/
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
item.stub(:[]).and_return('1') | |
item.stub(:[]).with(:name).and_return('Foo Inc') | |
item.stub(:[]).with(:thing_id).and_return(%w(1)) | |
item.stub(:[]).with(:error_description).and_return(['Successful']) | |
item.stub(:to_json).and_return('json data') |
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
@events = Event.where("venue_id = ?", current_user.venue.id).past_events | |
@events = Event.where("venue_id = ?", current_user.venue.id).upcoming_events | |
class Events | |
def past_events | |
past ||= self.select{|event| event.date < Date.today} | |
end | |
def upcoming_events |
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
gem "brakeman" | |
gem "railsbestpractices" | |
gem "guard" | |
gem "guard-livereload" | |
gem "guard-bundler" |
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
jQuery(container) | |
.append(jQuery('<div/>') | |
.addClass('blowout-item-picture') | |
.append( | |
jQuery('<img/>').attr('src', 'http://s3.amazonaws.com/ifrogz-images/images/promo/blowout/blowout-item-test.jpg') | |
) | |
) | |
.append(jQuery('<div/>') | |
.addClass('blowout-item-name') | |
.html(cat) |
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 VenuesController < ApplicationController | |
def venue_thanks | |
@user = User.find(current_user) | |
@venue = Venue.where(:user_id => @user.id) | |
if @venue.blank? | |
@venue = Venue.new(:name => params[:name], :address => params[:address], :max_guest_allowed => params[:max_guest_allowed], :user_id => @user ) | |
@msg = "Thanks for creating a venue!" | |
@venue.save | |
else |
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 VenuesController < ApplicationController | |
def create | |
@user = User.find(current_user) | |
@venue = Venue.where(:user => @user) | |
if @venue.blank? | |
@venue = Venue.create(params[:venue]) | |
end | |
end | |
end |
Keep in mind that most of these articles are opinionated and you may not agree with every one of them, that's fine. Learn what you can, figure out how to improve your code and if you know of some other resources let's add them to the list.
Javascript Basics:
- https://developer.mozilla.org/en-US/docs/JavaScript/Guide - This is must, Mozilla has done a great job with all of their tuts and their documentation. Definitely go here over something like w3schools.
- http://net.tutsplus.com/tutorials/javascript-ajax/the-basics-of-object-oriented-javascript/ - Good introduction to some basic javascript principles.
- http://shichuan.github.com/javascript-patterns/ - This has great examples of various patterns and anti-patterns.
- http://honza.ca/2012/07/large-javascript-application-tips - Great advice on doing large javascript apps. In general I find that these are important to follow even on the smallest project, you never know how it'll grow.
- http://www.codethinked.com/preparing-yourself-for-modern-javascript-d
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
set -e | |
echo "Updates packages. Asks for your password." | |
sudo zypper update | |
echo "Installs packages. Give your password when asked." | |
sudo zypper install build-essential bison openssl libmagic-dev libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 mysql-client mysql-server libmysql-ruby libmysqlclient-dev libxml2-dev libxslt-dev autoconf libc6-dev nodejs | |
echo "Installs ImageMagick for image processing" | |
sudo zypper install imagemagick |
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
img_call = function(url){ | |
$('<img />').attr('src', url).load(function(){console.log(this.width); console.log(this.height);}); | |
}; | |
// Image Dimension return version | |
img_attr = function(url){ | |
var img_attributes = {}; | |
$('<img />').attr('src', url).load(function(){ | |
img_attributes.width = this.width; |