Skip to content

Instantly share code, notes, and snippets.

View sebastienwindal's full-sized avatar

Sebastien Windal sebastienwindal

View GitHub Profile
#myAnimatedText {
background-color: red;
-webkit-transition-property: background-color;
-webkit-transition-duration: 1.0s;
}
#myAnimatedText:hover {
background-color: blue;
}
function SomeController($scope, etc..) {
$(function() {
$scope.requestPending = true;
$scope.errorMessage = "";
(...)
});
function SomeController($scope, $location, roster, classSection)
{
$scope.requestPending = false;
$scope.errorMessage = "";
$(function() {
$scope.requestPending = true;
$scope.errorMessage = "";
});
}
<i class="icon-spinner icon-spin" ng-show="requestPending"></i>
<div class="button" role="button">Login</div>
@sebastienwindal
sebastienwindal / NSFetchedResultsControllerDelegate
Last active December 31, 2015 15:19
NSFetchedResultsControllerDelegate implementation quick copy and paste.
#pragma mark NSFetchedResultsControllerDelegate
-(void) controllerWillChangeContent:(NSFetchedResultsController *)controller
{
[self.tableView beginUpdates];
}
-(void) controllerDidChangeContent:(NSFetchedResultsController *)controller
{
[self.tableView endUpdates];
-(void) action:(UIButton *)sender
{
CGRect buttonFrame = [sender convertRect:sender.bounds toView:self.tableView];
NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:buttonFrame.origin];
...
}
@sebastienwindal
sebastienwindal / static grouped cell background color
Created February 25, 2014 18:45
static grouped cell background color
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
cell.backgroundColor = [UIColor clearColor];
}
@sebastienwindal
sebastienwindal / tableview & collectionview cell "pressed down" effect
Last active October 15, 2015 06:19
Generic starting point to give a (more or less) subtle visual cue a tableview row is being selected.
/// table view
-(void) tableView:(UITableView *)tableView didHighlightRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
cell.contentView.alpha = 0.7;
[UIView animateWithDuration:0.15
delay:0.0
options:UIViewAnimationOptionCurveEaseInOut
for (NSString *familyName in [UIFont familyNames]) {
for (NSString *fontName in [UIFont fontNamesForFamilyName:familyName]) {
NSLog(@"%@", fontName);
}
}