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
PostTableItem *pitem = [PostTableItem itemWithPost:post | |
dataSource:self | |
expanded:expanded | |
withBlock:nil]; | |
pitem.urlBlock = ^{ | |
[self.controller expandCellWithPost:post type:!expanded]; | |
}; | |
SECOND WAY: |
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
CGContextRef currentContext = UIGraphicsGetCurrentContext(); | |
if(self.selected) | |
{ | |
CGColorSpaceRef colorSpace =CGColorSpaceCreateDeviceRGB(); | |
UIColor *startColor = [UIColor fromHexString:@"222222"]; | |
CGFloat *startColorComponents =(CGFloat *)CGColorGetComponents([startColor CGColor]); | |
UIColor *endColor = [UIColor fromHexString:@"444444"]; | |
CGFloat *endColorComponents =(CGFloat *)CGColorGetComponents([endColor CGColor]); | |
CGFloat colorComponents[8] = { |
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
//Parsing URLS OUT: | |
NSArray *comp = [self.shareView.textView.text componentsSeparatedByString:@" "]; | |
NSRegularExpression *expression = [NSRegularExpression regularExpressionWithPattern:@"(?i)\\b((?:[a-z][\\w-]+:(?:/{1,3}|[a-z0-9%])|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?«»“”‘’]))" options:NSRegularExpressionCaseInsensitive error:NULL]; | |
nonCountingChars = 0; | |
replaceCnt = 0; | |
if(comp.count) | |
{ | |
[linklist removeAllObjects]; | |
for(NSString *txt in comp) |
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
- (NSTextCheckingResult *)linkAtPoint:(CGPoint)point | |
{ | |
CGRect selfBounds = self.bounds; | |
static const CGFloat kVMargin = 5.0f; | |
if (!CGRectContainsPoint(CGRectInset(selfBounds, 0, -kVMargin), point)) | |
{ | |
return nil; | |
} | |
[self createTextFrame]; |
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
UIButton *peopleFilter = [UIButton buttonWithType:UIButtonTypeCustom]; | |
peopleFilter.frame = CGRectMake(5, 3, 90, 28); | |
[peopleFilter setImage:[UIImage imageNamed:@"radio_button_off"] forState:UIControlStateNormal]; | |
[peopleFilter setImage:[UIImage imageNamed:@"radio_button_on"] forState:UIControlStateSelected]; | |
peopleFilter.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter; | |
peopleFilter.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft; | |
[peopleFilter setTitle:@"PEOPLE & PLAYERS" forState:UIControlStateNormal]; | |
peopleFilter.titleEdgeInsets = (UIEdgeInsets){2, 2, 0, 0}; | |
peopleFilter.titleLabel.font = [UIFont fontWithName:@"Gotham-Bold" size:11]; |
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
Class (^PropertyClass)(NSMutableDictionary **); | |
PropertyClass = ^(NSMutableDictionary **dict){ | |
/** | |
Doing stuff here | |
**/ | |
return nil; | |
}; |
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
This happens more often when making ajax request. To fix I have to delete teh write.lock file. | |
Java::JavaLang::RuntimeException (org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: NativeFSLock@/Users/kmussel/development/Kyck/kyck_registrar_web/db/ha_neo_1/index/lucene/node/UserData_exact/write.lock): | |
org.neo4j.index.impl.lucene.LuceneDataSource.newIndexWriter(LuceneDataSource.java:701) | |
org.neo4j.index.impl.lucene.LuceneDataSource.syncGetIndexSearcher(LuceneDataSource.java:588) | |
org.neo4j.index.impl.lucene.LuceneDataSource.getIndexSearcher(LuceneDataSource.java:552) | |
org.neo4j.index.impl.lucene.LuceneIndex.query(LuceneIndex.java:268) | |
org.neo4j.index.impl.lucene.LuceneIndex.query(LuceneIndex.java:227) | |
org.neo4j.index.impl.lucene.LuceneIndex.query(LuceneIndex.java:238) | |
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) |
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
(develop)$ jruby -S trinidad | |
Deploying from /kyck_registrar_web as / | |
Initializing ProtocolHandler ["http-bio-0.0.0.0-4244"] | |
jruby 1.7.4 (1.9.3p392) 2013-05-28 fffffff on Java HotSpot(TM) 64-Bit Server VM 1.7.0_21-b12 [darwin-x86_64] | |
using 1:5 runtime pool with acquire timeout of 5.0 seconds | |
Config HA cluster, ha.server_id: 2, db: /db/ha_neo_server_2 | |
Connecting to database specified by database.yml | |
/config/initializers/devise.rb:247 warning: already initialized constant VERIFY_PEER | |
added application to pool, size now = 1 | |
Starting ProtocolHandler ["http-bio-0.0.0.0-4244"] |
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
public static Object createLink(final ODocument iFromVertex, | |
final OIdentifiable iTo, final String iFieldName) { | |
final Object out; | |
Object found = iFromVertex.field(iFieldName); | |
if (found == null) | |
// CREATE ONLY ONE LINK | |
out = iTo; | |
else if (found instanceof OIdentifiable) { | |
if (found.equals(iTo)) | |
// SAME LINK, SKIP IT |
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
require_relative 'rabbitmq.rb' | |
class Rpc | |
attr_reader :connection | |
attr_reader :lock, :condition | |
attr_accessor :response, :call_id | |
DEFAULT_RETRY_TIMEOUT = 60 | |
def initialize(opts = {}) |
OlderNewer