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
//--Touch to dismiss keyboard | |
UIButton *dismissKeyboardButtonBg = [UIButton buttonWithType:UIButtonTypeCustom]; | |
dismissKeyboardButtonBg.backgroundColor = [UIColor clearColor]; | |
[dismissKeyboardButtonBg addTarget:self action:@selector(dismissKeyboard:) forControlEvents:UIControlEventTouchUpInside]; | |
[dismissKeyboardButtonBg setFrame:CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height)]; | |
[dismissKeyboardButtonBg setAutoresizingMask:UIViewAutoresizingFlexibleWidth]; | |
[self.view addSubview:dismissKeyboardButtonBg]; |
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
//dim the screen base on a slider value | |
[[UIScreen mainScreen] setBrightness:[(UISlider *)sender value]/100]; |
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
if ( [[[UIDevice currentDevice] systemVersion] floatValue] >= 5.0 ) | |
NSLog (@"iOS version is greater than 5.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
//setup a UISlider programmatically | |
mySlider = [[[UISlider alloc] initWithFrame:CGRectMake(174, 12, 120, 23)] autorelease]; | |
mySlider.maximumValue = 100; | |
mySlider.minimumValue = 30; | |
mySlider.value = 100; | |
[mySlider addTarget:self action:@selector(dimScreen:) forControlEvents:UIControlEventValueChanged]; | |
//adding the slider to a table cell | |
cell.textLabel.text = @"My Slider"; | |
cell.accessoryView = mySlider; |
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
//HTML part | |
<div class="select-wrapper"> | |
<select id="search_filter"> | |
<option value='username'>Username (recommended)</option> | |
<option value='lastname'>Lastname</option> | |
</select> | |
</div> | |
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
$("#id_of_textbox").keyup(function(event){ | |
if(event.keyCode == 13){ | |
$("#id_of_button").click(); | |
} | |
}); |
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
(function($) { | |
// $ Works! You can test it with next line if you like | |
// console.log($); | |
})( jQuery ); |
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
//type this in the url field after page load | |
javascript:alert(document.documentElement.innerHTML); |
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
//version specific | |
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'></script> | |
//always up to date | |
<script type='text/javascript' src='http://code.jquery.com/jquery-latest.js'></script> | |
//jquery ui | |
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script> |
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 name="garden" multiple="multiple"> | |
<option>Flowers</option> | |
<option selected="selected">Shrubs</option> | |
<option>Trees</option> | |
<option selected="selected">Bushes</option> | |
<option>Grass</option> | |
<option>Dirt</option> | |
</select> |
NewerOlder