Skip to content

Instantly share code, notes, and snippets.

View OdNairy's full-sized avatar

Roman Gardukevich OdNairy

View GitHub Profile
GET /questionary/scripts/helper.php?callback=jQuery172032966944482177496_1385636607054&cmd=vote&scheduleId=121&questionId=14844&value=1&_=1385636609975 HTTP/1.1
Host: www.tut.by
Accept: */*
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.57 Safari/537.36
Referer: http://i.tut.by/missit2013.html
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8,ru;q=0.6,pl;q=0.4
Cookie: __utuid=d8scu643-48f9zlvp-5fqjukg-37idfwih-27a5x3jw; lvutm=0; muid=54149114075; __utma=108158727.1610473201.1385636607.1385636607.1385636607.1; __utmb=108158727.1.10.1385636607; __utmc=108158727; __utmz=108158727.1385636607.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); by4_tut_questionary=5ecacf00b380c48011d263736727eabb
@OdNairy
OdNairy / Podfile
Created January 17, 2014 07:49
Disable Magical Record in Podfile for CocoaPods
class Pod::Podfile
def self.MR_disable_logging(installer)
target = installer.project.targets.find{|t| t.to_s == "Pods-MagicalRecord"}
target.build_configurations.each do |config|
s = config.build_settings['GCC_PREPROCESSOR_DEFINITIONS']
s = [ '$(inherited)' ] if s == nil;
s.push('MR_ENABLE_ACTIVE_RECORD_LOGGING=0') if config.to_s == "Debug";
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = s
end
end
- (NSArray *)timelineRecordsFromEvents:(NSArray *)events {
WOTimelineRecord *lastRecord = [self.items lastObject];
WOTimeLineSessionGroup *lastSessionGroup = (lastRecord.type == WOTimelineRecordTypeGroupedAuthEvents) ? lastRecord.item : nil;
NSMutableArray *newRecords = [NSMutableArray new];
NSMutableArray *sessionEvents = [NSMutableArray new];
for (int i = 0; i < [events count]; i++) {
WOTimeLineEvent *event = events[i];
@implementation UIWindow (WLOAnalytics)
+(void)load{
Class class = [UIWindow class];
SEL swizzleIt = @selector(sendEvent:);
SEL swizzleTo = @selector(WLORuntime_sendEvent:);
Method methodIt = class_getClassMethod(class, swizzleIt);
Method methodTo = class_getClassMethod(class, swizzleTo);
method_exchangeImplementations(methodIt, methodTo);
@OdNairy
OdNairy / objc-accessors.mm
Created December 10, 2014 11:24
The real difference between atomic/nonatomic
if (!atomic) {
oldValue = *slot;
*slot = newValue;
} else {
spin_lock_t *slotlock = &PropertyLocks[GOODHASH(slot)];
_spin_lock(slotlock);
oldValue = *slot;
*slot = newValue;
_spin_unlock(slotlock);
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
NSObject* ob = [NSObject new];
dispatch_async(dispatch_get_main_queue(), ^{
NSLog(@"A: %d",[ob retainCount]);
dispatch_async(dispatch_get_main_queue(), ^{
NSLog(@"B: %d",[ob retainCount]);
});
NSLog(@"C: %d",[ob retainCount]);
});
union u_t {
int a;
short b;
char c;
} __attribute__((__transparent_union__)) U;
@OdNairy
OdNairy / decompiled
Last active August 29, 2015 14:15
Objective-c FOR-IN construction decompiled .
NSFastEnumerationState traitsListEnumerationState;
id traitsListObjectsPtr;
NSUInteger traitStorageListsCount = [traitStorageLists countByEnumeratingWithState:&traitsListEnumerationState objects:&traitsListObjectsPtr count:16LL];
int* v77 = 0LL;
long v28 = 0LL;
if (traitStorageListsCount){
v28 = *v77;
do {
for(size_t i = 0; i< traitStorageListsCount; ++i){
/* if (*v77 != v28){
#EXTM3U url-tvg=http://help.telecom.by/_files/TelecomTV/TelecomTVepg.zip,http://help.telecom.by/_files/TelecomTV/icons.zip
#EXTINF:-1 aspect-ratio=4:3 tvg-name="Беларусь 1" group-title="Социальный пакет", Беларусь 1 (тест)
udp://@233.81.116.1:1234
#EXTINF:-1 aspect-ratio=4:3 tvg-name="Беларусь 2", Беларусь 2 (тест)
udp://@233.81.116.2:1234
#EXTINF:-1 aspect-ratio=4:3 tvg-name=“Русская ночь“, Русская ночь (тест)
udp://@233.81.116.57:1234
#EXTINF:-1 aspect-ratio=4:3 tvg-name="Беларусь 3", Беларусь 3 (тест)
udp://@233.81.116.7:1234
{
"machineId" : 18,
"questionnaireData" : {
"1-3 When do you plan to place an order" : "May 14, 2015",
"3-2 What is the platen configuration required?" : "SPI",
"3-7 How many injection units do you require per machine?" : "Single 1",
"3-10 Will you be running regrind and\/or filled material?" : "Regrind materials: YES, Filled materials: YES",
"1-1 What is the account\/customer category?" : "Returning",
"5-2 Size" : "small\/high shot volume",
"2-5 What cycle overall times are expected or targeted for the machine?" : "min: 1\nmax:1",