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
rails new checkonce | |
cd checkonce | |
git init | |
git add . | |
git commit -m"init" | |
heroku login | |
gem install heroku |
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
#force push | |
git push -f | |
#track current branch to the remote | |
git push -u | |
git branch --set-upstream cmt origin/story/find_connections | |
#revert to the given saw | |
git revert <saw_id> |
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
New gem with bundler | |
bundle gem gem_name | |
edit gem_name.gemspec file | |
gem build gem_name.gemspec | |
gem push .gem # .gem file generated from above |
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
You can simply find the file type of a file where file.content_type doesnot works | |
options[:form] = "./lib/cf/cli/templates/sample-line/form.html" | |
file_type = IO.popen(["file", "--brief", "--mime-type", options[:form]], in: :close, err: :close).read.chomp | |
The return type is simply "text/html" |
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
#restore .sql file to the database | |
mysql target-db-name < sql-file-name.sql -uuser -p | |
# [mysql dir]/bin/mysql -h hostname -u root -p | |
Create a database on the sql server. | |
mysql> create database [databasename]; | |
List all databases on the sql server. | |
mysql> show databases; |
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
def show | |
@product = Product.find(params[:id]) | |
respond_to do |format| | |
format.html # show.html.erb | |
format.json { render :json => @product } | |
format.xml { render :xml => @product } | |
end | |
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
just one of the HTTP error response codes that Active Resource will handle with its own exception. The following HTTP response codes will also result in these exceptions: | |
200..399 - Valid response. No exceptions, other than these redirects: | |
301, 302, 303, 307 - ActiveResource::Redirection | |
400 - ActiveResource::BadRequest | |
401 - ActiveResource::UnauthorizedAccess |
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
# Copy Paste these to Setting - User | |
{ | |
"bold_folder_labels": false, | |
"color_scheme": "Packages/Color Scheme - Default/Solarized (Light).tmTheme", | |
"folder_exclude_patterns": | |
[ | |
".svn", | |
".git", | |
".hg", |
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
http://www.cmarshall.net/MySoftware/ajax/index.html | |
http://www.catswhocode.com/blog/mastering-html5-prefetching | |
http://docs.jquery.com/AjaxQueue | |
http://api.jquery.com/queue/ | |
http://stackoverflow.com/questions/4666130/how-would-i-design-a-client-side-queue-system | |
http://www.cmarshall.net/MySoftware/ajax/Threads/ | |
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
/*! | |
* $.preload() function for jQuery – http://mths.be/preload | |
* Preload images, CSS and JavaScript files without executing them | |
* Script by Stoyan Stefanov – http://www.phpied.com/preload-cssjavascript-without-execution/ | |
* Slightly rewritten by Mathias Bynens – http://mathiasbynens.be/ | |
* Note that since this script relies on jQuery, the preloading process will not start until jQuery has finished loading. | |
*/ | |
jQuery.preload = function(array) { | |
var length = array.length, |
OlderNewer