Skip to content

Instantly share code, notes, and snippets.

View kwylez's full-sized avatar

Cory D. Wiles kwylez

View GitHub Profile
<?php
require_once 'Zend/Service/Twitter.php';
class CW_Twitter extends Zend_Service_Twitter {
public function __construct($username, $password) {
parent::__construct($username, $password);
}
public function getOtherUserFriends($name) {
@kwylez
kwylez / gist:647794
Created October 26, 2010 21:01
Force backbaritem to show
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
self.navigationItem.title = @"Back";
[self.navigationItem setHidesBackButton:YES animated:NO];
[self.navigationController.navigationBar setNeedsDisplay];
}
//
// CWCustomAccessoryView.h
// CustomAccessory
//
// Created by Cory Wiles on 10/8/10.
// Copyright (c) 2010 __MyCompanyName__. All rights reserved.
//
#import <UIKit/UIKit.h>
- (void)fixupAdView:(UIInterfaceOrientation)toInterfaceOrientation {
if (adBannerView != nil) {
[super configureIAdContentSizes];
[UIView beginAnimations:@"fixupViews" context:nil];
CGFloat toolbarHeight = self.toolbar.frame.size.height;
- (BOOL)isEqual:(id)other {
if (other == self)
return YES;
if (!other || ![other isKindOfClass:[self class]])
return NO;
return [self isEqualToWidget:other];
}
- (BOOL)isEqualToWidget:(MyWidget *)aWidget {
if (self == aWidget)
/**
* properties are (int) numberOfViews, (int) secondsForRotation, (MyCustomObject) myCustomObject
*/
- (BOOL)isEqualToCustomWidget:(CustomWidget *)aCustomWidget {
if (self == aCustomWidget)
return YES;
if (numberOfViews != [aCustomWidget numberOfViews])
/**
* Assume that first name is the first instance of characters before the first
* " ". Everything else will be considered the last name.
*/
NSArray *nameSplitArray = [self.employee.name componentsSeparatedByString:@" "];
NSMutableArray *nameSplitMutableArray = [nameSplitArray mutableCopy];
[nameSplitMutableArray removeObjectAtIndex:0];
// set the first and last name properties
// Parent UIViewControlller
- (void)viewWillAppear:(BOOL)animated {
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(refreshSearchBarControllerWithDepartmentCode:)
name:@"DepartmentCodeNotification"
object:nil];
[super viewWillAppear:animated];
<?php
$dir = ".";
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
echo "filename: $file : filetype: " . filetype($dir . $file) . "\n";
}
closedir($dh);
}
<?php
$d = dir(".");
echo "Handle: " . $d->handle . "\n";
echo "Path: " . $d->path . "\n";
while (false !== ($entry = $d->read())) {
echo $entry."\n";
}
$d->close();
?>