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
typedef struct FontHeader { | |
int32_t fVersion; | |
uint16_t fNumTables; | |
uint16_t fSearchRange; | |
uint16_t fEntrySelector; | |
uint16_t fRangeShift; | |
}FontHeader; | |
typedef struct TableEntry { | |
uint32_t fTag; |
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
@interface NSFileManager (DoNotBackup) | |
- (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL; | |
@end |
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
BOOL RSIsEmpty(id obj) { | |
return obj == nil || obj == [NSNull null] || ([obj respondsToSelector:@selector(length)] && [(NSData *)obj length] == 0) || ([obj respondsToSelector:@selector(count)] && [obj count] == 0); | |
} | |
BOOL RSStringIsEmpty(NSString *s) { | |
/*22 Feb. 2011: added NSNull check. JSON parser can put a null where we expect a string, and NSNull throws an exception when checking length. Since [NSNull null] is, arguably, emptiness, it makes sense to include it.*/ | |
return s == nil || (id)s == (id)[NSNull null] || [s length] == 0; | |
} |
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
# Hockey | |
# | |
# A air hockey game for two players. First to | |
# seven wins. | |
# Most of the game is drawn with the scene | |
# module. Goal and winner messages are animated | |
# with layers. | |
from scene import * | |
from sound import * |
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
from scene import * | |
from random import choice, randrange | |
import sound | |
TILE_SIZE=64 #size of tile | |
SDX=4 #selection frame size | |
M=3 #match 3(?) game | |
NOS = (-1, -1) #constant to indicate clear selection | |
FALL_S=0.2 #speed of fall per each tile | |
FALL_T=0 #constant fall tile |
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
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
SILENT = ENV['SL_SILENT'] =~ /false/i ? false : true || true | |
VERSION = '2.2.23' | |
# SearchLink by Brett Terpstra 2015 <http://brettterpstra.com/projects/searchlink/> | |
# MIT License, please maintain attribution | |
require 'net/https' | |
require 'uri' |