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
var redis = require("redis") | |
, subscriber = redis.createClient() | |
, publisher = redis.createClient(); | |
subscriber.on("message", function(channel, message) { | |
console.log("Message '" + message + "' on channel '" + channel + "' arrived!") | |
}); | |
subscriber.subscribe("test"); |
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
// | |
// NSObject+AutoCoder.h | |
// AutoCoder | |
// | |
// Created by Sergey Popov on 03.02.16. | |
// Copyright © 2016 Sergey Popov. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
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
http://iphonedevwiki.net/index.php/Preferences.app | |
http://pastie.org/pastes/8305153 |
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
// | |
// Detect the device | |
// | |
#define IS_IPHONE_4 (fabs((double)[[UIScreen mainScreen]bounds].size.height - (double)480) < DBL_EPSILON) | |
#define IS_IPHONE_5 (fabs((double)[[UIScreen mainScreen]bounds].size.height - (double)568) < DBL_EPSILON) | |
#define IS_IPHONE_6 (fabs((double)[[UIScreen mainScreen]bounds].size.height - (double)667) < DBL_EPSILON) | |
#define IS_IPHONE_6_PLUS (fabs((double)[[UIScreen mainScreen]bounds].size.height - (double)736) < DBL_EPSILON) | |
// |
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
find . -name \*.m | xargs genstrings -o en.lproj |
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
//Original http://cocoasnippets.io/cocoa/ui/nswindow/coregraphics/2014/02/27/translucent-nswindow-with-blurred-background.html | |
// one more solution http://stackoverflow.com/questions/11174918/how-to-get-window-with-semi-transparent-blurred-background | |
typedef void * CGSConnection; | |
extern OSStatus CGSSetWindowBackgroundBlurRadius(CGSConnection connection, NSInteger windowNumber, int radius); | |
extern CGSConnection CGSDefaultConnectionForThread(); | |
- (void)enableBlurForWindow:(NSWindow *)window | |
{ | |
[window setOpaque:NO]; | |
window.backgroundColor = [NSColor colorWithCalibratedWhite:1.0 alpha:0.5]; |
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
// OS X | |
#define NSColorFromRGBA(r,g,b,a) [NSColor colorWithCalibratedRed:r/255.f green:g/255.f blue:b/255.f alpha:a/100.f] | |
#define NSColorFromHex(rgbValue) [NSColor colorWithCalibratedRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0] | |
// iOS | |
#define UIColorFromRGBA(r,g,b,a) [UIColor colorWithRed:r/255.f green:g/255.f blue:b/255.f alpha:a/100.f] | |
#define UIColorFromHex(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.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
NSDictionary *dictCodes = [NSDictionary dictionaryWithObjectsAndKeys:@"972", @"IL", | |
@"93", @"AF", @"355", @"AL", @"213", @"DZ", @"1", @"AS", | |
@"376", @"AD", @"244", @"AO", @"1", @"AI", @"1", @"AG", | |
@"54", @"AR", @"374", @"AM", @"297", @"AW", @"61", @"AU", | |
@"43", @"AT", @"994", @"AZ", @"1", @"BS", @"973", @"BH", | |
@"880", @"BD", @"1", @"BB", @"375", @"BY", @"32", @"BE", | |
@"501", @"BZ", @"229", @"BJ", @"1", @"BM", @"975", @"BT", | |
@"387", @"BA", @"267", @"BW", @"55", @"BR", @"246", @"IO", | |
@"359", @"BG", @"226", @"BF", @"257", @"BI", @"855", @"KH", | |
@"237", @"CM", @"1", @"CA", @"238", @"CV", @"345", @"KY", |
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
# Xcode | |
.DS_Store | |
*/build/* | |
*.pbxuser | |
!default.pbxuser | |
*.mode1v3 | |
!default.mode1v3 | |
*.mode2v3 | |
!default.mode2v3 | |
*.perspectivev3 |