Skip to content

Instantly share code, notes, and snippets.

// Ionic Starter App
// angular.module is a global place for creating, registering and retrieving Angular modules
// 'starter' is the name of this angular module example (also set in a <body> attribute in index.html)
// the 2nd parameter is an array of 'requires'
angular.module('starter', ['ionic'])
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
if (window.cordova && window.cordova.plugins.Keyboard) {
./sendab.sh
This is ApacheBench, Version 2.3 <$Revision: 1528965 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking services.viber.com (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
@bandicoot86
bandicoot86 / gist:d2f85aa3c42d6fcefe7c
Created December 26, 2015 10:09
Performance check, 2 EC2 instances
./sendab.sh
This is ApacheBench, Version 2.3 <$Revision: 1528965 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking services.viber.com (be patient)
Completed 3000 requests
Completed 6000 requests
Completed 9000 requests
Completed 12000 requests
Server1:
~/viber$ ./sendab.sh
This is ApacheBench, Version 2.3 <$Revision: 1528965 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking services.viber.com (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
ab -n 1000 -c 20 -T "application/json" -p m.json https://services.viber.com/vibersrvc/1/send_message
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking services.viber.com (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
@bandicoot86
bandicoot86 / gist:d53736c718cc881aed44
Created August 23, 2015 21:18
Add this to enable internet
ionic plugin add https://github.com/apache/cordova-plugin-whitelist.git
@Test
public void testJoiner() throws Exception {
List<String> texts = Lists.newArrayList("eins", null, "drei", "vier", "fünf", "sechs", "sieben", null);
String joined;
String expected;
joined = Joiner.on(";")
.skipNulls()
.join(texts);
var myApp = angular.module('myApp').service('CordovaNetwork', ['$ionicPlatform', '$q', function($ionicPlatform, $q) {
// Get Cordova's global Connection object or emulate a smilar one
var Connection = window.Connection || {
"CELL" : "cellular",
"CELL_2G" : "2g",
"CELL_3G" : "3g",
"CELL_4G" : "4g",
"ETHERNET" : "ethernet",
"NONE" : "none",
"UNKNOWN" : "unknown",
07 Jul 2015 11:55:39.177 [SimpleAsyncTaskExecutor-4] INFO sd-viber-core - Sending to http https://services.viber.com/vibersrvc/1/send_message pl {"service_id":3010,"dest":"79261532939","tag":"tag","seq":347937,"type":6,"message":{"#txt":"www.ya.ru"}}
07 Jul 2015 11:55:39.191 [SimpleAsyncTaskExecutor-4] ERROR sd-viber-core - org.apache.http.NoHttpResponseException: services.viber.com:443 failed to respond
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:143)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:57)
at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:261)
at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:165)
at org.apache.http.impl.conn.CPoolProxy.receiveResponseHeader(CPoolProxy.java:167)
at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:272)
at org.apache.http.protocol.HttpR
@bandicoot86
bandicoot86 / gist:98239db5fe34740ec423
Created June 5, 2015 13:17
setenv.sh to tomcat/bin to set java arguments
export JAVA_OPTS="-Dfile.encoding=UTF-8 -Xms128m -Xmx1024m -XX:PermSize=64m -XX:MaxPermSize=256m"