Skip to content

Instantly share code, notes, and snippets.

View kibotu's full-sized avatar
🎯
Focusing

Jan Rabe kibotu

🎯
Focusing
View GitHub Profile
@gohilbhagirath90
gohilbhagirath90 / Set Property from android application
Created September 9, 2015 09:10
Set System Properties from android application
==> Add in AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:sharedUserId="android.uid.system"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.example"
>
==> Android Source :
// For Properties permission
// Properties which start with "debug." have both SYSTEM & SHELL permisiion to edit
@dylanwatsonsoftware
dylanwatsonsoftware / ColorGenerator.java
Created June 11, 2015 16:06
Java version of @m1ch4ls C# ColorGenerator
public class ColorGenerator {
public static List<Color> generate(int colors, int skip) {
final int lastindex = colors + skip;
return new Points(colors + skip).asList().subList(skip, lastindex);
}
// RYB color space
private static class RYB {
private static final double[] White = { 1, 1, 1 };
@flarb
flarb / SDKSwap.cs
Created May 23, 2015 18:50
Swap between Unity3D Google Cardboard and Gear VR / OVR Mobile SDKs. It swaps out the Android manifest files when you switch platforms--pretty much all you need (aside from wrapping the APIs) to switch platforms.
using UnityEngine;
using System.Collections;
using UnityEditor;
using System.IO;
public class SDKSwap : EditorWindow {
static string _cardboardPath;
static string _OVRPath;
@j3j5
j3j5 / gist:8b3e48ccad746b90a54a
Last active November 16, 2023 15:11
Adyen Test Card Numbers
Adyen Test Card Numbers
These cards are only valid on our TEST system and they will never involve any actual transaction or transfer of funds. The TEST card numbers will not work on the Adyen LIVE Platform.
For all cards use the following expiration and CVV2/CVC2/or CID for Amex.
For all cards:
Expiration Dates CVV2 / CVC3 CID (American Express)
08/2018 OR 10/2020 737 7373
@nisrulz
nisrulz / proguard-rules.pro
Created April 5, 2015 06:14
Android : Proguard Rules for a Library Module
#
# This ProGuard configuration file illustrates how to process a program
# library, such that it remains usable as a library.
# Usage:
# java -jar proguard.jar @library.pro
#
# Save the obfuscation mapping to a file, so we can de-obfuscate any stack
# traces later on. Keep a fixed source file attribute and all line number
# tables to get line numbers in the stack traces.
@ferdy182
ferdy182 / CircularRevealingFragment.java
Created March 27, 2015 17:18
Make circular reveal animations on a fragment
/**
* Our demo fragment
*/
public static class CircularRevealingFragment extends Fragment {
OnFragmentTouched listener;
public CircularRevealingFragment() {
}
#!/bin/bash
#sudo apt-get install libxml2-utils
GetGoogleSourceFile () {
[ "-$1" == "-" ] && return 1
curl -s --compressed -G -d "format=text" --url "$GOOGLE_SOURCE_URL/${3:-platform/frameworks/base}/${2:-+/master}/$1" | base64 -d
}
GetRepositoryXmlURL () {
@Azazle
Azazle / DefaultUserAgent.java
Last active June 8, 2018 18:47
Android method: get default user-agent
// http://matsuhilog.blogspot.jp/2013/05/performance-analytics-in-android.html
// https://code.google.com/p/codenameone/issues/detail?id=294
public static String getDefaultUserAgent(Context context) {
String ua;
if (Build.VERSION.SDK_INT >= 17) {
ua = Util.getDefaultUserAgent(context);
} else if (Build.VERSION.SDK_INT >= 16) {
ua = Util.getUserAgent(context);
} else {
try {
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@homj
homj / DrawerIconDrawable.java
Last active April 6, 2017 10:11
This Drawable implements the "Drawer-Indicator to Arrow"-Animation as seen in several Material-Design-Apps; NOTE: Mind the updated constructors in Revision 5!
/*
* Copyright 2014 Johannes Homeier
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software