This file contains hidden or 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
import json | |
import requests | |
# Authentication for user filing issue (must have read/write access to | |
# repository to add issue to) | |
USERNAME = 'CHANGEME' | |
PASSWORD = 'CHANGEME' | |
# The repository to add this issue to | |
REPO_OWNER = 'CHANGEME' |
This file contains hidden or 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
import static org.junit.Assert.assertEquals; | |
import java.io.IOException; | |
import org.apache.log4j.Logger; | |
import org.apache.lucene.analysis.Analyzer; | |
import org.apache.lucene.analysis.cjk.CJKAnalyzer; | |
import org.apache.lucene.document.Document; | |
import org.apache.lucene.document.Field.Store; | |
import org.apache.lucene.document.TextField; |
This file contains hidden or 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
// setup code to draw / display avatar | |
UIView *avatarView = [[UIView alloc] init]; | |
avatarView.frame = CGRectMake(20, 50, 280, 100); | |
avatarView.layer.borderColor = [UIColor redColor].CGColor; | |
avatarView.layer.borderWidth = 3.0f; | |
[self.view addSubview:avatarView]; | |
// do additional loading for avatars | |
UIButton *avatarButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; | |
// the last two values control the size of the button |
This file contains hidden or 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
NSMutableDictionary *userInfo = [NSMutableDictionary dictionary]; | |
[userInfo setObject:@"You are not authenticated." forKey:NSLocalizedDescriptionKey]; | |
NSError *error = [NSError errorWithDomain:@"mydomain" code:0 userInfo:userInfo]; |
This file contains hidden or 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
//@author http://stackoverflow.com/questions/5712527/how-to-detect-total-available-free-disk-space-on-the-iphone-ipad-device | |
- (uint64_t)freeDiskspace | |
{ | |
uint64_t totalSpace = 0; | |
uint64_t totalFreeSpace = 0; | |
NSError *error = nil; | |
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); | |
NSDictionary *dictionary = [[NSFileManager defaultManager] attributesOfFileSystemForPath:[paths lastObject] error: &error]; |