Skip to content

Instantly share code, notes, and snippets.

View longlongjump's full-sized avatar

Eugene Ovchynnykov longlongjump

View GitHub Profile
upstream domain1 {
server 127.0.0.1:3000;
server 127.0.0.1:3001;
server 127.0.0.1:3002;
}
server {
listen 80;
server_name www.domain.com;
rewrite ^/(.*) http://domain.com permanent;
@longlongjump
longlongjump / gist:3195553
Created July 29, 2012 01:03
file uploading
NSString *file_path = [[NSBundle mainBundle] pathForResource:@"06 mullet fever" ofType:@"mp3"];
NSURL *url = [NSURL URLWithString:@"http://urbanentourage.com"];
AFHTTPClient *client = [AFHTTPClient clientWithBaseURL:url];
NSMutableURLRequest *req = [client multipartFormRequestWithMethod:@"POST"
path:@"api/sightings"
parameters:[NSDictionary dictionaryWithObject:@"DOU1" forKey:@"sighting[name]"]
constructingBodyWithBlock:^(id<AFMultipartFormData> formData) {
[formData appendPartWithFileData:[NSData dataWithContentsOfFile:file_path]
name:@"sighting[sound]"
(function() {
if (window.WDBO !== undefined)
return;
var WBDO = {
log_scope: {"ERROR": "error",
"INFO": "info",
"WARNING": "warn"},
Y: YUI({}),
@longlongjump
longlongjump / bzz
Created June 16, 2011 13:44
enter touch
//////////////////////////////////////////////////////////////////////////////////////////
// touch enter club
-(void)testEnterClub
{
ClubEntrance *entrance = [ClubEntrance entry];
entrance.userId = @"13";
entrance.clubId = @"13";
entrance.location = CLLocationCoordinate2DMake(42.730881,-74.000893);
entrance.radius = 100;
//
// StatusOnAppDelegate.m
// StatusOn
//
// Created by Sergey Gavrilyuk on 5/16/11.
// Copyright 2011 SoftTechnics. All rights reserved.
//
#import "StatusOnAppDelegate.h"
#import "JSON.h"