Skip to content

Instantly share code, notes, and snippets.

Mohit Kanwal creativepsyco

Block or report user

Report or block creativepsyco

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
creativepsyco /
Created Jan 19, 2016
Get account info from the phone. Requires ACCOUNT Permission in the manifest.
Account[] accounts = AccountManager.get(getView().getContext()).getAccounts();
Set<String> emailSet = new HashSet<>();
for (Account account : accounts) {
if (EMAIL_PATTERN.matcher( {
getView().txtPlaceName.setAdapter(new ArrayAdapter<>(getView().getContext(),
android.R.layout.simple_dropdown_item_1line, new ArrayList<>(emailSet)));
View issue127.diff
diff --git i/app/src/main/java/org/fossasia/openevent/activities/ w/app/src/main/java/org/fossasia/openevent/activities/
index 1c80d92..9b01b7f 100644
--- i/app/src/main/java/org/fossasia/openevent/activities/
+++ w/app/src/main/java/org/fossasia/openevent/activities/
@@ -35,35 +35,30 @@ import org.fossasia.openevent.OpenEventApp;
import org.fossasia.openevent.R;
import org.fossasia.openevent.dbutils.DataDownload;
import org.fossasia.openevent.dbutils.DbSingleton;
import static;
import static;
import static;
import static;
import static;
import static;
import static;
import static;
import static org.hamcrest.Matchers.not;
package com.example.sample.orm.migration;
import com.example.sample.framework.base.ui.AppLogger;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;
import io.realm.Realm;
View headers
Received: by with SMTP id z203csp338871iod;
Thu, 9 Apr 2015 05:00:50 -0700 (PDT)
X-Received: by with SMTP id uk7mr59805915wjc.13.1428580848509;
Thu, 09 Apr 2015 05:00:48 -0700 (PDT)
Return-Path: <>
Received: from ( [])
by with ESMTP id fu19si23795394wjc.14.2015.
for <>;
creativepsyco / apktool.rb
Last active Aug 29, 2015
Apktool Brew 2.0.0rc4
View apktool.rb
require 'formula'
class Apktool < Formula
homepage ''
url ''
sha1 '61123bcc472fa76907d405d82afda1c6e40c46bf'
resource 'exes' do
url ''
sha1 '508f031c81b42386ddc5fff304fee3ae11fd765b'
creativepsyco / build.gradle
Created Feb 18, 2015
Automatically add Git revision information when building SNAPSHOT versions of an App
View build.gradle
Integer VERSION_CODE = 16
String VERSION_NAME = getVersionName("0.4-SNAPSHOT")
def getVersionName(String preferredVersionName) {
if (preferredVersionName.contains("-SNAPSHOT")) {
return getGitStatus(preferredVersionName)
} else {
return preferredVersionName
creativepsyco /
Created Jan 28, 2015
Batch Authorizer for Pusher Java Client.
class BatchAuthorizer extends HttpAuthorizer {
private final Collection<String> channelsToSub;
private Map<String, JSONObject> cachedAuthMap = new HashMap<>();
* We need the socket id to know when to refresh the batch auth data
private String authSocketId = "";
creativepsyco /
Last active Jun 1, 2018
Custom Button Widget which applies a ripple onto buttons above API > 21 and normal state list selectors for API < 21. Also you can set the corner radius.
package com.mohitkanwal.framework.control.base;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
creativepsyco /
Created Nov 24, 2014
How to launch a restart intent.
Intent intent = new Intent(getActivity(), HomeActivity.class);
You can’t perform that action at this time.