Skip to content

Instantly share code, notes, and snippets.

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

Curl Cheat Sheet

  1. Get a html content from an url

     curl http://www.exmaple.com
    
  2. -o Get a html content and save it to a file

curl -o example.html http://www.exmaple.com

@nextsummer33
nextsummer33 / iphone-uiview-inner-shadow.m
Created July 17, 2013 06:58
inner shadow for uiview
CGRect bounds = [self bounds];
CGContextRef context = UIGraphicsGetCurrentContext();
CGFloat radius = 0.5f * CGRectGetHeight(bounds);
// Create the "visible" path, which will be the shape that gets the inner shadow
// In this case it's just a rounded rect, but could be as complex as your want
CGMutablePathRef visiblePath = CGPathCreateMutable();
CGRect innerRect = CGRectInset(bounds, radius, radius);
CGPathMoveToPoint(visiblePath, NULL, innerRect.origin.x, bounds.origin.y);
#if __IPHONE_OS_VERSION_MIN_REQUIRED <= __IPHONE_6_1
//code here
#endif
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$
# 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};
@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);
# 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