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
[SSZipArchive unzipFileAtPath:(NSString *) | |
toDestination:(NSString *)destinationFolderPath]; |
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
imageView.image = [UIImage imageWithData: | |
[UIData dataWithContentsOfURL: | |
[NSURL urlWithString: | |
[NSString stringWithFormat:@"http://my.imageurl.com/imagepath/%@", imageName] | |
] | |
] | |
]; | |
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
[imageView setImageWithURL:(NSURL *)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
NSDictionary *myJsonDict = [parser objectWithString:myJSONString]; |
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
- (IBAction) pressedPeelIt:(UIButton *)sender | |
{ | |
//Disable the button so they can't press it | |
self.peelIt.enabled = NO; | |
[self.textHere resignFirstResponder]; | |
//Create a new UIView and set the background color to be a UIColor with pattern image of a screen capture | |
UIView *imgView = [[UIView alloc] init]; | |
[self.view addSubview:imgView]; |
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
<?php | |
// the below code assumes you have the private/protected | |
// variable $this->_db set to your database adapter. | |
// begin the transaction | |
$this->_db->beginTransaction(); | |
try { | |
// mock insert into a user table | |
$result = $this->_db->insert('users', array( |
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() { | |
// for storing states | |
var states = []; | |
// cache some elems | |
var $states = $('#state'); | |
var $stateList = $('#state-list'); | |
// hide the dropdown and pull values | |
$states.hide().find('option').each(function() { |
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
<?php | |
/** | |
* Generates a uristub of maximum specified length. | |
* | |
* @access protected | |
* @param string $tableName The name of the table to query | |
* @param string $tableField The table column to check | |
* @param string $uristub The initial input string (page title) to clean | |
* @param int $length The maximum allowable length for the clean url | |
* @param mixed $iteration The current iteration, when duplicates found |
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
#Update the crucial options | |
UPDATE wp_options | |
SET option_value = 'http://newdomain.com' | |
WHERE option_name in ('siteurl', 'home'); | |
#Make sure search engines can access the deployed site | |
UPDATE wp_options | |
SET option_value = 1 | |
WHERE option_name = 'blog_public'; | |
#Set the GUIDs to have the correct domain | |
UPDATE wp_posts |
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 there_can_be_only_one_highlander(the_one) { | |
var state_speed = 500, | |
immortals = ['#welcome-box', '#guest-box', '#login-box', '#register-box'], | |
to_kill = [], | |
key = null; | |
for (key in immortals) { | |
if (immortals[key] !== the_one) { | |
if (typeof immortals[key] === 'string') { | |
to_kill.push(immortals[key]); |
OlderNewer