Skip to content

Instantly share code, notes, and snippets.

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",
@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);
@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
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
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
@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
./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
// 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) {
-Djava.security.egd=file:/dev/urandom
"to":"cjFZhREpxz8:APA91bG_WmuMpNWQ3xTMR9mzVEM2GEYHHkG2O3Ye-XFLBFsAlt6ZlYd_ZHIiqi0raTWUBlDNBTS453gFMbrgpiiBiBAbtSc7eUpoe03_IwZWUG5Q6Yz_NlxTXNZ_lHEMIm9dwZVMTfgQ","data":{"sdInfo":{"sdLogin":"atfbanksd","sdUuid":"678d2751-fa39-4c43-86de-c3276b66de24","p":1},"message":"сваваываыв","notId":"678d2751-fa39-4c43-86de-c3276b66de24"},"notification":{"body":"сваваываыв","title":"Atfbank"}}