Skip to content

Instantly share code, notes, and snippets.

Avatar
🎃
woah, how close was that?

Ozodrukh ozodrukh

🎃
woah, how close was that?
View GitHub Profile
View xss-game.md

XSS-game by Google

Welcome, recruit! Cross-site scripting (XSS) bugs are one of the most common and dangerous types of vulnerabilities in Web applications. These nasty buggers can allow your enemies to steal or modify user data in your apps and you must learn to dispatch them, pronto!

At Google, we know very well how important these bugs are. In fact, Google is so serious about finding and fixing XSS issues that we are paying mercenaries up to $7,500 for dangerous XSS bugs discovered in our most sensitive products.

In this training program, you will learn to find and exploit XSS bugs. You'll use this knowledge to confuse and infuriate your adversaries by preventing such bugs from happening in your applications.

There will be cake at the end of the test.

View gist:685ee1a1b0f9d7467cb2
data:text/html,
<html>
<head>
<meta charset="utf-8" />
<style type="text/css" media="screen">
body{
padding: 0;
margin: 0;
background: #eaeaea;
}
View android_development.md

Android Development

Gradle

Enable Gradle Daemon

Speed up Gradle build times by enabling the Gradle Daemon

echo org.gradle.daemon=true >> ~/.gradle/gradle.properties
View RevealDrawable.java
package com.pixite.fragment.widget;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.Drawable.Callback;
import android.view.Gravity;
@ozodrukh
ozodrukh / LocaleUtils.java
Last active Aug 29, 2015
LocaleUtils change application & system locale of resources on the fly
View LocaleUtils.java
package uz.uza.news.utils;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Build;
import java.util.Locale;
public final class LocaleUtils {
@ozodrukh
ozodrukh / app_build.gradle
Last active Aug 29, 2015
[Gradle] Add square dependecies
View app_build.gradle
//usage in modules just add
dependencies {
addSquareUpArtifacts ":app", 'retrofit', '1.9.0', 'okhttp', '2.3.0'
}
@ozodrukh
ozodrukh / FileUtils.java
Created Apr 9, 2015
Some useful file utility methods
View FileUtils.java
public static String humanReadableByteCount(long bytes, boolean si) {
int unit = si ? 1000 : 1024;
if (bytes < unit) return bytes + " B";
int exp = (int) (Math.log(bytes) / Math.log(unit));
String pre = (si ? "kMGTPE" : "KMGTPE").charAt(exp-1) + (si ? "" : "i");
return String.format("%.1f %sB", bytes / Math.pow(unit, exp), pre);
}
@ozodrukh
ozodrukh / DrawablesCompat.java
Created Apr 11, 2015
Android Drawable loader alternative
View DrawablesCompat.java
package codetail.project.watchme.common.drawables;
import android.annotation.TargetApi;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.content.res.XmlResourceParser;
import android.graphics.BitmapFactory;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Build;
View AdvancedIntStatistics.java
package spoon.test;
import spoon.reflect.declaration.*;
import java.util.ArrayList;
import java.util.IntSummaryStatistics;
import java.util.TreeSet;
import java.util.function.Consumer;
import java.util.function.ToIntFunction;
View JNIWrapper.h
#ifndef __JniWrapper_h__
#define __JniWrapper_h__
#include <jni.h>
#include <string>
#include <exception>
//#include <boost/noncopyable.hpp>
namespace Android