Skip to content

Instantly share code, notes, and snippets.

View jarinudom's full-sized avatar

Jarin Udom jarinudom

View GitHub Profile
[_exploreTableView beginUpdates];
// Remove Users
NSUInteger count=[_dataArray count];
for(int i=max_val;i<count;i++) {
[_dataArray removeObjectAtIndex:[users count]];
if(_selectedView==kExploreUsersView && _exploreTableView) {
[uiView deleteRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:(max_val+2) inSection:0]] withRowAnimation:kDefaultDeleteAnimation];
}
// In cellForRowAtIndexPath
static NSString *CellIdentifier = @"MyCustomCell";
MyCustomCell *cell = (MyCustomCell *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSArray *topLevelObjects = [[NSBundle mainBundle]
loadNibNamed:@"MyCustomCell"
owner:nil options:nil];
- (void)scrollViewDidEndDecelerating:(UITableView *)tv {
if([tv isKindOfClass:[UITableView class]]) {
// do some stuff
}
}
- (void)scrollViewDidEndDragging:(UITableView *)tv willDecelerate:(BOOL)decelerate {
if ([tv isKindOfClass:[UITableView class]] && !decelerate) {
// do some stuff
}
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView cellForRowAtIndexPath:indexPath].image = nil;
}
# xcode noise
build
*.pbxuser
*.mode1v3
*.mode2v3
*.swp
*~.nib
*.perspective
*.perspectivev3
# users/index
def index
if current_user
@search = User.visible.without_user(current_user).search(params[:search])
else
@search = User.visible.search(params[:search])
end
MPMoviePlayerController* moviePlayer = [[MPMoviePlayerController alloc]
initWithContentURL:someUrl];
moviePlayer.movieControlMode = MPMovieControlModeHidden;
[moviePlayer play];
NSArray* windows = [[UIApplication sharedApplication] windows];
if ([windows count] > 1) {
UIWindow *moviePlayerWindow = [[UIApplication sharedApplication] keyWindow];
[moviePlayerWindow addSubview:yourCustomOverlayView];
}
1. Go to http://blizzcon.rayv.com/
2. Click on High Quality and install their RayV viewer
3. Restart your browser and go back to http://blizzcon.rayv.com/
4. Type this script in your address bar and hit enter:
javascript:Rayv.Embed("rayvHost", {"Affiliate": "DTVblizzcon", "ChannelID": "blizzl3", "Volume": "100", "CoverImageURL": "http://static.blizzcon.rayv.com/www/Images/rayv_viewer_install.jpg" });
#!/usr/bin/env ruby
def tagz0r(char)
return char if char == " "
tagz0r = %w{b i u s sub sup}.at(rand(6))
colorz0r = %w{aqua black blue fuchsia green lime purple red teal}.at(rand(9))
sizez0r = (6..9).to_a.at(rand(4))
fontz0r = ["courier", "comic sans", "impact", "times new roman"].at(rand(4))
#!/usr/bin/env ruby
def tagz0r(char)
return char if char == " "
tagz0rz = %w{b i u s sub sup}.select{|c| rand(2) == 1}
colorz0r = %w{aqua black blue fuchsia magenta orange yellow cyan green lime purple red teal}[rand(13)]
sizez0r = (4..7).to_a[rand(4)]
fontz0r = ["Arial","Century Gothic","Book Antiqua","Comic Sans MS","Courier New","Fixedsys","Franklin Gothic Medium","Garamond","Impact","Lucida Console","System","Times New Roman","Trebuchet MS","Verdana"][rand(4)]