First create a Ubuntu 13.04 x64 droplet on DigitalOcean Control Panel
Then ssh with root account, run this in termianl:
$ wget -qO- https://raw.github.com/progrium/dokku/master/bootstrap.sh | sudo bash
[ | |
{ | |
line: "Сокольническая линия", | |
stations: ["Улица Подбельского", "Черкизовская", "Преображенская площадь", "Сокольники", "Красносельская", "Комсомольская", "Красные ворота", "Чистые пруды", "Лубянка", "Охотный ряд", "Библиотека имени Ленина", "Кропоткинская", "Парк культуры", "Фрунзенская", "Спортивная", "Воробьёвы горы", "Университет", "Проспект Вернадского", "Юго-Западная"] | |
}, | |
{ | |
line: "Замоскворецкая линия", | |
stations: ["Красногвардейская", "Домодедовская", "Орехово", "Царицыно", "Кантемировская", "Каширская", "Коломенская", "Автозаводская", "Павелецкая", "Новокузнецкая", "Театральная", "Тверская", "Маяковская", "Белорусская", "Динамо", "Аэропорт", "Сокол", "Войковская", "Водный стадион", "Речной вокзал"] | |
}, | |
{ |
// Java. | |
int sum = 0; | |
for (int i = 0; i < arr.length; i++) { | |
sum += arr[i]; | |
} | |
System.out.println(sum); | |
// Scala (ignoring arr.sum). | |
println(arr reduceLeft { _ + _ }) |
NSURL *url = [NSURL URLWithString:@"http://someurl.com/"]; | |
AFHTTPClient *httpClient = [[AFHTTPClient alloc] initWithBaseURL:url]; | |
// don't forget to set parameterEncoding! | |
httpClient.parameterEncoding = AFJSONParameterEncoding; | |
NSDictionary *params = @{@"key" : @"value"}; | |
NSMutableURLRequest *request = [httpClient requestWithMethod:@"POST" path:@"" parameters:params]; | |
AFHTTPRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:nil failure:nil]; | |
[operation start]; |
[[UINavigationBar appearance] setTintColor:[UIColor grayColor]]; | |
[[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(0, -60) forBarMetrics:UIBarMetricsDefault]; // Takes out title | |
UIImage *backButtonImage = [UIImage imageNamed:@"BackArrowDark.png"]; | |
if ([UINavigationBar instancesRespondToSelector:@selector(setBackIndicatorImage:)]) { | |
[[UINavigationBar appearance] setBackIndicatorImage:backButtonImage]; | |
[[UINavigationBar appearance] setBackIndicatorTransitionMaskImage:backButtonImage]; | |
} else { | |
int imageSize = 21; // REPLACE WITH YOUR IMAGE WIDTH |
// Developer/Library/Frameworks/SenTestingKit.framework/Headers/SenTestCaseRun.h | |
SENTEST_EXPORT NSString * const SenTestCaseDidStartNotification; | |
SENTEST_EXPORT NSString * const SenTestCaseDidStopNotification; | |
SENTEST_EXPORT NSString * const SenTestCaseDidFailNotification; | |
// Developer/Library/Frameworks/SenTestingKit.framework/Headers/SenTestDistributedNotifier.h | |
SENTEST_EXPORT NSString * const SenTestNotificationIdentifierKey; | |
// Developer/Library/Frameworks/SenTestingKit.framework/Headers/SenTestSuiteRun.h | |
SENTEST_EXPORT NSString * const SenTestSuiteDidStartNotification; |
/* | |
* Copyright (C) 2013 Siddhesh S Shetye | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
using System; | |
using System.Collections.Generic; | |
public delegate void Callback(); | |
public delegate void Callback<T>(T arg1); | |
public delegate void Callback<T, U>(T arg1, U arg2); | |
public delegate void Callback<T, U, V>(T arg1, U arg2, V arg3); | |
public enum MessengerMode { | |
DONT_REQUIRE_LISTENER, |
/* | |
pluralForm(28, forms: ["год", "года", "лет"]) | |
output: "лет" | |
*/ | |
func pluralForm(number: Int, forms: [String]) -> String { | |
return number % 10 == 1 && number % 100 != 11 ? forms[0] : | |
(number % 10 >= 2 && number % 10 <= 4 && (number % 100 < 10 || number % 100 >= 20) ? forms[1] : forms[2]) | |
} |
web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb |