Skip to content

Instantly share code, notes, and snippets.

@anirudh24seven
anirudh24seven / GitHub_Improvement_Ideas
Last active August 29, 2015 14:10
GitHub improvements Ideas
Inspired by GitHub plugins like ZenHub and OctoTree, I thought of the following ideas to make the GitHub ecosystem better:
1. Karma Points:
Problem:
Some people create a lot of GitHub projects with very little code of their own and most of it being boilerplate. Their commit history also shows only insignificant changes.
There is a need for a proper points system in GitHub that reflects your true skill. More like StackOverflow points.
Possible solution:
@anirudh24seven
anirudh24seven / Stats
Last active August 29, 2015 13:57
WordPress for Android - Some stats
Ran this to find out number of files and lines of code, in the project:
git diff --stat `git hash-object -t tree /dev/null` | tail -1
The output as of 10-03-2014 12:15 IST was:
1420 files changed, 106561 insertions(+)
$ find . -name "*.java" | wc -l
src/org/wordpress contains 311 .java files
src/org/xmlrpc contains 13 .java files
@anirudh24seven
anirudh24seven / WordPress.java
Created March 4, 2014 04:48
WordPress for Android - WordPress.java
package org.wordpress.android;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.Activity;
import android.app.Application;
import android.content.ComponentCallbacks2;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
@anirudh24seven
anirudh24seven / WordPress.java
Created March 4, 2014 04:25
WordPress for Android - Volley setup
...
@Override
public void onCreate() {
...
// Volley networking setup
requestQueue = Volley.newRequestQueue(this, getHttpClientStack());
imageLoader = new ImageLoader(requestQueue, getBitmapCache());
@anirudh24seven
anirudh24seven / WordPress.java
Created March 4, 2014 04:18
WordPress for Android - initWpDb() and createAndVerifyWpDb in WordPress.java
...
private void initWpDb() {
if (!createAndVerifyWpDb()) {
AppLog.e(T.DB, "Invalid database, sign out user and delete database");
SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(this).edit();
currentBlog = null;
editor.remove(WordPress.WPCOM_USERNAME_PREFERENCE);
editor.remove(WordPress.WPCOM_PASSWORD_PREFERENCE);
editor.remove(WordPress.ACCESS_TOKEN_PREFERENCE);
@anirudh24seven
anirudh24seven / WordPress.java
Created March 4, 2014 04:04
WordPress for Android - onCreate() in WordPress.java
...
@Override
public void onCreate() {
versionName = getVersionName();
initWpDb();
wpStatsDB = new WordPressStatsDB(this);
mContext = this;
// Volley networking setup
@anirudh24seven
anirudh24seven / WordPress.java
Created March 4, 2014 04:00
WordPress for Android - getVersionName() in WordPress.java
...
private String getVersionName() {
PackageManager pm = getPackageManager();
try {
PackageInfo pi = pm.getPackageInfo(getPackageName(), 0);
return pi.versionName == null ? "" : pi.versionName;
} catch (NameNotFoundException e) {
return "";
}
@anirudh24seven
anirudh24seven / AndroidManifest.xml
Created March 4, 2014 03:20
WordPress for Android - AndroidManifest having an android:name attribute with WordPress as attribute
...
<application
android:name="WordPress"
android:allowBackup="false"
android:hardwareAccelerated="true"
android:icon="@drawable/app_icon"
android:label="@string/app_name"
android:theme="@style/WordPress" >
@anirudh24seven
anirudh24seven / WordPress.java
Created March 2, 2014 14:31
WordPress for Android - WordPress extends Application and this onCreate() method is the first code to be called
public class WordPress extends Application {
...
public void onCreate() {
versionName = getVersionName();
initWpDb();
...
@anirudh24seven
anirudh24seven / AndroidManifest.xml
Created March 2, 2014 14:14
WordPress for Android - AndroidManifest points to PostsActivity as the Launcher activity
<application
android:name="WordPress"
android:allowBackup="false"
android:hardwareAccelerated="true"
android:icon="@drawable/app_icon"
android:label="@string/app_name"
android:theme="@style/WordPress" >
...
<activity