Skip to content

Instantly share code, notes, and snippets.

@Pitus660
Pitus660 / UncaughtExceptionHandler
Created November 14, 2014 16:11
CrashLytics method
private Thread.UncaughtExceptionHandler defaultHandler;
class PushUncaughtExceptionHandler
implements Thread.UncaughtExceptionHandler {
@Override
public void uncaughtException(Thread thread, Throwable ex) {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("PUSH expection----> " + thread.getName() + "exx--> " + ex.getCause()+"\n");
for (StackTraceElement element : ex.getStackTrace()) {
stringBuilder.append(element.toString() + "\n");
@TargetApi(14)
private void overrideLifeCycle(Context ctx) {
Application application = (Application) ctx.getApplicationContext();
application.registerActivityLifecycleCallbacks(new Application.ActivityLifecycleCallbacks() {
@Override
public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
Log.d("onActivityCreated --->" + activity.getLocalClassName());
}
@Override
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
Google Apps for Android 4.4.4 (https://www.androidfilehost.com/?fid=23501681358544845 - gapps-kk-20140606-signed.zip)
Google Apps for Android 4.3 (https://www.androidfilehost.com/?fid=23060877490000124 - gapps-jb-20130813-signed.zip)
Google Apps for Android 4.2 (https://www.androidfilehost.com/?fid=23060877490000128 - gapps-jb-20130812-signed.zip)
Google Apps for Android 4.1 (https://www.androidfilehost.com/?fid=22979706399755082 - gapps-jb-20121011-signed.zip)
@Pitus660
Pitus660 / gcmcss.js
Last active August 29, 2015 14:18 — forked from jamesvnz/gcmcss.js
var xmpp = require('node-xmpp');
//Set node-xmpp options.
//Replace with your projectID in the jid and your API key in the password
//The key settings for CCS are the last two to force SSL and Plain SASL auth.
var options = {
type: 'client',
jid: 'XXXXXXXXX@gcm.googleapis.com',
password: 'XXXXXXXX',
port: 5235,
@Pitus660
Pitus660 / google_speech2text.md
Created February 15, 2016 00:34 — forked from alotaiba/google_speech2text.md
Google Speech To Text API

Google Speech To Text API

Base URL: https://www.google.com/speech-api/v1/recognize
It accepts POST requests with voice file encoded in FLAC format, and query parameters for control.

Query Parameters

client
The client's name you're connecting from. For spoofing purposes, let's use chromium

lang
Speech language, for example, ar-QA for Qatari Arabic, or en-US for U.S. English

@Pitus660
Pitus660 / README.md
Created July 9, 2019 14:03 — forked from rantav/README.md
Find slow queries in mongo DB

A few show tricks to find slow queries in mongodb

Enable profiling

First, you have to enable profiling

> db.setProfilingLevel(1)

Now let it run for a while. It collects the slow queries ( > 100ms) into a capped collections, so queries go in and if it's full, old queries go out, so don't be surprised that it's a moving target...

@Pitus660
Pitus660 / currency-dropdown-list.html
Last active November 7, 2019 11:31 — forked from AmrMekkawy/currency-dropdown-list.html
Currency HTML "select" element (dropdown list)
<select class="custom-select mr-sm-2" id="productCurrency">
<option value="USD">United States Dollars</option>
<option value="EUR" selected >Euro</option>
<option value="GBP">United Kingdom Pounds</option>
<option value="DZD">Algeria Dinars</option>
<option value="ARP">Argentina Pesos</option>
<option value="AUD">Australia Dollars</option>
<option value="ATS">Austria Schillings</option>
<option value="BSD">Bahamas Dollars</option>
<option value="BBD">Barbados Dollars</option>