Skip to content

Instantly share code, notes, and snippets.

View 0xjmp's full-sized avatar

Jake Peterson 0xjmp

View GitHub Profile
angular.module('projects', [])
.directive('projectTable', function() {
return {
templateUrl: 'project-table.html',
scope: {
projects: '@'
}
};
});
class DataModelFactory
def getModeller(slug)
case slug
when 'amazon'
AmazonModel
when 'craigslist'
CraigslistModel
end
end
class DataModeller
# Override this method to specify the key-value exchange that
# should occur from the modeller.
def dataMapper
{}
end
end
GET /mobile/api/v1/advertisers HTTP/1.1
Host: g2.gumgum.com
Content-Type: application/json
Accept: */*
Cookie: ggu=u%3Df9c2329dde905104c6008a3a24df270ad3b30113933efafdfc98875257b84a38
User-Agent: GumGumiOSInternal/8 CFNetwork/703.2 Darwin/14.0.0
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Connection: keep-alive
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super initWithCoder:aDecoder];
if (self)
{
self.imageArray = [[NSMutableArray alloc] init];
[_imageArray insertObject:[UIImage imageNamed:@"mustache.png"] atIndex:1];
}
Warning: mysql_connect(): Access denied for user 'gumgum'@'ip-10-66-83-147.ec2.internal' (using password: YES) in /opt/releases/gumgum-dashboard/scripts/generate_ad_json.php on line 15
no connexion : Access denied for user 'gumgum'@'ip-10-66-83-147.ec2.internal' (using password: YES)
json.products @products do |product|
json.(product, :id, :price, :permalink)
end
#import <Foundation/Foundation.h>
typedef void (^DDURLCompletionBlock)(NSData *responseData, NSError *error);
@interface DDURLConnection : NSURLConnection
- (id)initWithRequest:(NSURLRequest *)request startImmediately:(BOOL)startImmediately completion:(DDURLCompletionBlock)completionBlock;
@end
@0xjmp
0xjmp / gist:11156123
Last active August 29, 2015 14:00
The main issue with this method is that it's performing a task ([NSData dataWithContentsOfURL]) on the main thread and is therefore blocking ui actions (such as scrolling) until it has finished loading the image. A secondary issue is that this method doesn't dequeue sufficiently. Dequeuing is a critical factor in increasing a scroll-based class'…
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MemeCell"];
if (cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"MemeCell"];
}
// Dequeue subviews
NSInteger tag = 1415;