Skip to content

Instantly share code, notes, and snippets.

John Smith pookie13

Block or report user

Report or block pookie13

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Caretpostion.html
<!DOCTYPE html>
<html ng-app="" ng-controller="myCtrl">
<body>
<input value="sample input value" ng-click="getCursorPos($event)" ng-keyup="getCursorPos($event)" id="searchTxt" type="text" />
<button ng-click="showAlert()">
<div> Cursor Position : <b ng-bind="pos"></b></div>
<script>
function myCtrl($scope) {
$scope.pos = document.getElementById('searchTxt').value.length ;
$scope.cursorPosVal = -1;
View TImePickerDialog.java
package com.app.pointme.voicenotificaction;
import android.app.DialogFragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
View FontChangeCrawler.java
public class FontChangeCrawler
{
private Typeface typeface;
public FontChangeCrawler(Typeface typeface)
{
this.typeface = typeface;
}
public FontChangeCrawler(AssetManager assets, String assetsFontFileName)
View CropImage.Java
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.provider.MediaStore;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import com.goparties.gpuser.util.CropImageView;
import java.io.IOException;
import butterknife.Bind;
View Handle Creshes
in Application class
@Override
public void uncaughtException(Thread thread, Throwable throwable) {
//throwable will tell you the resion of crash
PendingIntent pendingIntent = PendingIntent.getActivity(getBaseContext(), 0,
new Intent(this, WelcomeActivity.class), PendingIntent.FLAG_CANCEL_CURRENT);//pass Activity that you want to start at fatal.
AlarmManager mgr = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
mgr.set(AlarmManager.RTC, System.currentTimeMillis() + 500, pendingIntent);
System.exit(2);
@pookie13
pookie13 / counties
Created Jul 8, 2015
Countries code
View counties
[
{
"name": "Afghanistan",
"alpha-2": "AF",
"alpha-3": "AFG",
"country-code": "004",
"iso_3166-2": "ISO 3166-2:AF",
"region-code": "142",
"sub-region-code": "034"
},
View gist:a49d1ebd14580ecf7050
&quot; "
&amp; &
&apos; '
&lt; <
&gt; >
\u0020 " "
@pookie13
pookie13 / AsyncHelper.java
Created Jun 16, 2015
AsyncTask Class to Call multiple service
View AsyncHelper.java
import android.app.Activity;
import android.os.AsyncTask;
import android.util.Log;
import com.google.gson.Gson;
import com.hestabit.rqchat.connect.Connect;
import com.hestabit.rqchat.models.SignUp;
import org.apache.http.NameValuePair;
View DataBaseDl.java
// insert template in to DB(query)
public long insertdata(Model model) {
String sql = "INSERT INTO " + Databaseconnector.TABLE_TEMPLET
+ "(UNIQUEID,TEMPLET) VALUES (?,?)";
SQLiteStatement objStmt = sqliteDatabase.compileStatement(sql);
objStmt.bindString(1, Commonvariable.getUniqueID());
Log.d("tempValue", ""+model.getTemplet());
string=templetOb.getTemplet();
objStmt.bindString(2, templetOb.getTemplet());
long longValue = objStmt.executeInsert();
@pookie13
pookie13 / SharedHelper.java
Created Jun 5, 2015
Common function used in project.
View SharedHelper.java
public class SharedHelper {
private static NotificationManager mNotificationManager;
private static Class<?> aClass;
private static ProgressDialog progressDialog;
private static Uri mBaseUri;
private static SharedPreferences.Editor editor;
private static SharedPreferences pref;
private static Class<?> mClass;
You can’t perform that action at this time.