Skip to content

Instantly share code, notes, and snippets.

Avatar

Sebastiano Poggi rock3r

View GitHub Profile
@rock3r
rock3r / gw-update.sh
Last active Jun 3, 2020
Simple script to update Gradle from the command line (*NIX)
View gw-update.sh
#!/bin/sh
# License for any modification to the original (linked below):
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# Sebastiano Poggi wrote this file. As long as you retain
# this notice you can do whatever you want with this stuff. If we meet some day,
# and you think this stuff is worth it, you can buy us a beer in return.
#### SETUP/USAGE INSTRUCTIONS ####
View keybase.md

Keybase proof

I hereby claim:

  • I am rock3r on github.
  • I am rock3r (https://keybase.io/rock3r) on keybase.
  • I have a public key ASAFs_czYB4sp1Df7-lZ0TUdAT-5jye6IxjyE9OKPIVoIwo

To claim this, I am signing this object:

@rock3r
rock3r / AndroidOSVersionCheckerTest.kt
Created Oct 5, 2017
Testable Kotlin Android OS version checker, with tests
View AndroidOSVersionCheckerTest.kt
package me.seebrock3r.utils
import android.os.Build.VERSION_CODES.JELLY_BEAN_MR1
import android.os.Build.VERSION_CODES.JELLY_BEAN_MR2
import android.os.Build.VERSION_CODES.KITKAT
import android.os.Build.VERSION_CODES.LOLLIPOP
import android.os.Build.VERSION_CODES.LOLLIPOP_MR1
import android.os.Build.VERSION_CODES.M
import android.os.Build.VERSION_CODES.N
import org.assertj.core.api.Assertions.assertThat
@rock3r
rock3r / find_in_dependencies.gradle
Last active Oct 10, 2019
Utility Gradle task to find where duplicate classes come from (for Gradle 4.1+)
View find_in_dependencies.gradle
// H/t to https://github.com/ethankhall/scripts/blob/master/gradle/find-file.gradle for the idea;
// this re-written version actually works in modern Gradle and Android Gradle plugins.
task findInDependencies {
doLast {
println()
def resolvableConfigs = project.getConfigurations()
.stream()
.filter { it.isCanBeResolved() }
@rock3r
rock3r / avd_flush_anim.xml
Last active Jan 20, 2017
Standardised Japanese Toilet 🚽 Big Flush 🌀 pictogram - as Animated Vector Drawable
View avd_flush_anim.xml
<!-- All copyright to the original owners. The AVD version is free to use; please give attribution if you redistribute/modify -->
<animated-vector
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt">
<aapt:attr name="android:drawable">
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:width="693dp"
android:height="693dp"
android:viewportWidth="693"
@rock3r
rock3r / gfonts.py
Last active Oct 19, 2016
Rip fonts from Google Fonts for self-hosting, EZ
View gfonts.py
#!/usr/bin/python
#coding: utf-8
import argparse, os, tinycss, requests
def parse_cli_arguments():
parser = argparse.ArgumentParser(description='Downlads all available variants of a font from Google Fonts')
parser.add_argument('fontname', type=str, help='The name of the font. E.g., "Roboto", "Product Sans"')
return parser.parse_args()
@rock3r
rock3r / README.md
Last active May 10, 2019
A simple bash script to enable demo mode on a Marshmallow+ device via ADB (based on http://bit.ly/295BHLx)
View README.md

Usage

$ demo on|off [hhmm]

Enable or disable the demo mode on a connected Android device or emulator. You can also pass in a custom value for the system clock in the HHMM format (only used when you use the on command).

⚠️ This script only works on *nix systems and has only been tested on macOS with Bash (but should be portable).

@rock3r
rock3r / grabdng.py
Created Mar 20, 2016
Grabs all DNG files from the connected Android device's camera roll
View grabdng.py
#!/usr/bin/python
import argparse, os, subprocess
# Grab the script directory to use as default
current_directory = os.path.dirname(os.path.abspath(__file__))
def parse_cli_arguments():
parser = argparse.ArgumentParser(description = 'Grabs all DNG files from the connected Android device\'s camera roll.')
@rock3r
rock3r / giffify.py
Last active Mar 15, 2020
Giffify - easily create optimised GIFs from a video
View giffify.py
#!/usr/bin/python
# License for any modification to the original (linked below):
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# Sebastiano Poggi and Daniele Conti wrote this file. As long as you retain
# this notice you can do whatever you want with this stuff. If we meet some day,
# and you think this stuff is worth it, you can buy us a beer in return.
import argparse, sys, subprocess, tempfile
@rock3r
rock3r / boot-into-cwm.sh
Created Jun 4, 2015
Root script for Asus Zenfone 2 for *NIX
View boot-into-cwm.sh
#! /bin/bash
# How to use: save this in the folder where you extract the contents of this zip:
# http://click.xda-developers.com/api/click?format=go&jsonp=vglnk_14334252799608&key=f0a7f91912ae2b52e0700f73990eb321&libId=iai8ebh401000n4o000DAb9a6aa9o&loc=http%3A%2F%2Fforum.xda-developers.com%2Fzenfone2%2Fgeneral%2Fasus-zenfone-2-flashing-recovery-mode-t3096596&v=1&out=http%3A%2F%2Fwww.mediafire.com%2Fdownload%2Fv6m7n9j0gqins9b%2FCWM_Zenfone_2_Intel.zip&ref=http%3A%2F%2Fforum.xda-developers.com%2Fzenfone2%2Fgeneral&title=Asus%20Zenfone%202%20%7C%20Resources%20all%20in%20one%20thread%20%7C%20Asus%20ZenFone%202%20%7C%20XDA%20Forums&txt=%3Cb%3EDownload%20the%20Asus%20Zenfone%20temporary%20CWM%20package%3C%2Fb%3E
# Then chmod a+x it, and run it. Have your phone attached to the USB port with USB debugging enabled before starting.
# Setup
WORKINGDIR=$(pwd)
LAUNCHER="$WORKINGDIR/FB_RecoveryLauncher/recovery.launcher"
RECOVERY="$WORKINGDIR/FB_RecoveryLauncher/recovery.zip"
You can’t perform that action at this time.