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
NSString* someString = @"FooBar"; | |
BOOL someStringContainsFoo = ([someString rangeOfString: @"Foo"].location != NSNotFound); |
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
cat /etc/lsb-release |
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
select * from all_tab_columns where table_name = 'TABLE_NAME'; |
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
select | |
varchar_field, length(varchar_field) | |
from | |
table_name | |
where | |
length(varchar_field) in ( | |
select max(length(varchar_field)) from table_name | |
) |
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
select * from all_constraints where table_name = '<table_name>' | |
-- where constraint_type = 'P' -> primary key | |
-- = 'R' -> foreign keys | |
-- = 'C' -> constraints like not null |
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
select * from all_sequences; |
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
select | |
cols.table_name, | |
cols.column_name, | |
cols.position, | |
cons.status, | |
cons.owner | |
from | |
all_constraints cons inner join all_cons_columns cols on | |
cons.constraint_name = cols.constraint_name and | |
cons.owner = cols.owner |
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
NSURL* url = [[NSURL alloc] initWithString: @"http://www.cnn.com"]; | |
[[UIApplication sharedApplication] openURL: url]; |
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
# swappiness controls the intensity of swap use, varying between 0 and 100 | |
# this command modifies the swappiness in runtime, but the change won't persist after shutdown | |
sudo sysctl -w vm.swappiness=0 |
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
# to change the default folder locations in ubuntu, | |
# just edit this file, following the instruction inside it | |
vi $HOME/.config/user-dirs.dirs |
OlderNewer