rake test TEST=test/controllers/test_controller_rest.rb
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
+ (instancetype)sharePreference { | |
static TFUserPreference *sharePreference = nil; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
sharePreference = [[self alloc] init]; | |
}); | |
return sharePreference; | |
} |
SQLite3 Cheat Sheet
Download from: http://www.sqlite.org/download.html Getting Started: http://www.sqlite.org/sqlite.html Documentation: http://www.sqlite.org/docs.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
declare @rr varchar(1000) | |
set @rr ='variable content' | |
select * from A | |
where A.SchoolDID = @rr | |
select top (1000)* from B |
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
/\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i | |
/ start of regex | |
\A match start of a string | |
[\w+\-.]+ at least one word character, plus, hyphen, or dot | |
@ literal "at sign" | |
[a-z\d\-.]+ at least one letter, digit, hyphen, or dot | |
\. literal dot | |
[a-z]+ at least one letter | |
\z match end of a string | |
/ end of regex |
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 _3.2.13_ new my_app |
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
login without password | |
mysql -uroot | |
login using password | |
mysql -uroot -p | |
after login, change user password | |
mysql> use mysql; | |
SET PASSWORD FOR 'user-name-here'@'hostname-name-here' = PASSWORD('new-password-here'); | |
UPDATE mysql.user SET Password=PASSWORD('new-password-here') WHERE User='user-name-here' AND Host='host-name-here'; |
SELECT relname, relpages FROM pg_class ORDER BY relpages DESC LIMIT toprungsjobs_backup=> SELECT relname, relpages FROM pg_class ORDER BY relpages DESC LIMIT 5;
SELECT pg_size_pretty(pg_relation_size('pg_attribute'));
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
vdebug | |
• <F5>: start/run (to next breakpoint/end of script) | |
• <F2>: step over | |
• <F3>: step into | |
• <F4>: step out | |
• <F6>: stop debugging | |
• <F7>: detach script from debugger | |
• <F9>: run to cursor |
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
1. Custom Navigation Transitions | |
http://captechconsulting.com/blog/tyler-tillage/ios-7-tutorial-series-custom-navigation-transitions-more | |
2. iOS Design Cheat Sheet | |
http://ivomynttinen.com/blog/the-ios-7-design-cheat-sheet/ |