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
# the IP(s) on which your node server is running. I chose port 3000. | |
upstream app_server { | |
server 127.0.0.1:3000; | |
keepalive 64; | |
} | |
# the nginx server instance | |
server { | |
listen 80; | |
server_name #{servername}; |
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
server { | |
listen 80; | |
server_name server_name; | |
access_log /var/log/app/access.log; | |
error_log /var/log/app/error.log; | |
# https://docs.djangoproject.com/en/dev/howto/static-files/#serving-static-$ | |
location /static { # STATIC_URL | |
alias /path/to/app/static; # STATIC_R$ |
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
#if __IPHONE_OS_VERSION_MIN_REQUIRED <= __IPHONE_6_1 | |
//code here | |
#endif |
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
CGSize textSize = [label.text sizeWithFont:label.font | |
constrainedToSize:CGSizeMake(label.frame.size.width, MAXFLOAT) | |
lineBreakMode:label.lineBreakMode]; | |
label.frame = (CGRect){.origin=label.origin,.size={ceilf(textSize.width), ceilf(textSize.height)}}}; |
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 MyClass:NSObject | |
{ | |
SystemSoundID mySound; | |
} | |
@implementation MyClass | |
- (void) viewDidLoad { | |
[super viewDidLoad]; | |
NSString *soundPath = [[NSBundle mainBundle] pathForResource:@"changeTrack" ofType:@"aif"]; | |
AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath: soundPath], &mySound); |
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
# Header 1 # | |
## Header 2 ## | |
### Header 3 ### (Hashes on right are optional) | |
#### Header 4 #### | |
##### Header 5 ##### | |
## Markdown plus h2 with a custom ID ## {#id-goes-here} | |
[Link back to H2](#id-goes-here) | |
This is a paragraph, which is text surrounded by whitespace. Paragraphs can be on one |
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
// begin a new image context, to draw our colored image onto | |
UIGraphicsBeginImageContext(img.size); | |
// get a reference to that context we created | |
CGContextRef context = UIGraphicsGetCurrentContext(); | |
// set the fill color | |
[color setFill]; |