Skip to content

Instantly share code, notes, and snippets.

View ozodrukh's full-sized avatar
🎃
woah, how close was that?

Ozodrukh ozodrukh

🎃
woah, how close was that?
View GitHub Profile

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.

@ozodrukh
ozodrukh / gist:685ee1a1b0f9d7467cb2
Created July 23, 2014 19:42
Notepad for Chrome
data:text/html,
<html>
<head>
<meta charset="utf-8" />
<style type="text/css" media="screen">
body{
padding: 0;
margin: 0;
background: #eaeaea;
}

Android Development

Gradle

Enable Gradle Daemon

Speed up Gradle build times by enabling the Gradle Daemon

echo org.gradle.daemon=true >> ~/.gradle/gradle.properties
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 / app_build.gradle
Last active August 29, 2015 14:18
[Gradle] Add square dependecies
//usage in modules just add
dependencies {
addSquareUpArtifacts ":app", 'retrofit', '1.9.0', 'okhttp', '2.3.0'
}
@ozodrukh
ozodrukh / LocaleUtils.java
Last active August 29, 2015 14:18
LocaleUtils change application & system locale of resources on the fly
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 / FileUtils.java
Created April 9, 2015 17:46
Some useful file utility methods
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 April 11, 2015 12:06
Android Drawable loader alternative
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;
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;
#ifndef __JniWrapper_h__
#define __JniWrapper_h__
#include <jni.h>
#include <string>
#include <exception>
//#include <boost/noncopyable.hpp>
namespace Android