This file contains hidden or 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
- command + a to go to the beginning of a line | |
- command + e to go to the end of a line | |
- alt+f forward word (unless system shortcut for file menu) | |
- alt+b back word | |
- command + b back char | |
- command + f forward char. | |
- command + u to kill (cut) from current location to beginning of the line | |
- command + k to kill (cut) from current location to end of line | |
- command + w to kill (cut) from current location to beginning of word | |
- command + y to paste (copied / cut) lines |
This file contains hidden or 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
- (UIImage *)imageOfView:(UIView *)view | |
{ | |
// This if-else clause used to check whether the device support retina display or not so that | |
// we can render image for both retina and non retina devices. | |
if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) | |
{ | |
UIGraphicsBeginImageContextWithOptions(view.bounds.size, view.opaque, 0.0); | |
} | |
else |
This file contains hidden or 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
<html> | |
<head> | |
<link href="http://vadimg.com/twitter-bootstrap-wizard-example/bootstrap/css/bootstrap.min.css" rel="stylesheet"> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | |
<script src="http://vadimg.com/twitter-bootstrap-wizard-example/bootstrap/js/bootstrap.min.js"></script> | |
<script src="http://vadimg.com/twitter-bootstrap-wizard-example/jquery.bootstrap.wizard.js"></script> | |
</head> | |
<body> | |
<div id="rootwizard"> |
This file contains hidden or 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
In your PhotoController index action get the top 3 un-voted photos: | |
``` | |
@photos = Photo.unvoted.limit(3) | |
``` | |
Then in your view you wrap each photo within a div, and give this div a data-id attribute with the photo's id as the value. Example: | |
``` | |
<div id="photos"> |
This file contains hidden or 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
Country.create( name: "Afghanistan", code: "AF" ) | |
Country.create( name: "Aland Islands", code: "AX") | |
Country.create( name: "Albania", code: "AL",visa_required: true ) | |
Country.create( name: "Algeria", code: "DZ" ) | |
Country.create( name: "American Samoa", code: "AS" ) | |
Country.create( name: "Andorra", code: "AD" ) | |
Country.create( name: "Angola", code: "AO" ) | |
Country.create( name: "Anguilla", code: "AI" ) | |
Country.create( name: "Antarctica", code: "AQ" ) | |
Country.create( name: "Antigua and Barbuda", code: "AG" ) |
This file contains hidden or 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 yes?('Would you like to install country select') | |
gem('country_select') | |
end | |
gem 'bootstrap-will_paginate' | |
gem 'stamp' | |
gem 'gom_theme', path: '../gom_theme' | |
gem 'validates_timeliness' | |
gem_group :development do |
This file contains hidden or 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
# deploybtn Gemfile | |
source 'https://rubygems.org' | |
gem "rake", ">= 0.9.2" | |
gem 'rails', ">= 3.2.7" | |
gem 'json' | |
gem "rails_config", "0.2.5" | |
gem "guid" |
This file contains hidden or 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
private bool ValidateCreditCardNumber(string creditCardNumber) | |
{ | |
//Replace any character other than 0-9 with "" | |
creditCardNumber = Regex.Replace(creditCardNumber,@"[^0-9]",""); | |
int cardSize = creditCardNumber.Length; | |
//Creditcard number length must be between 13 and 16 | |
if (cardSize >= 13 && cardSize <= 16) | |
{ |
This file contains hidden or 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
def full_name | |
if first_name.blank? | |
last_name | |
else | |
[first_name, last_name].compact.join(' ') | |
end | |
end |
NewerOlder