Skip to content

Instantly share code, notes, and snippets.

View ryanbateman's full-sized avatar
🥑
avocado

Ryan Bateman ryanbateman

🥑
avocado
  • London, United Kingdom
View GitHub Profile
@Jonty
Jonty / deredactatron.py
Last active October 10, 2023 20:39
The Deredactatron: De-redacts PDF's redacted by drawing rectangles over the text. Needs Python3 and PyMuPDF
#!/usr/bin/env python3
# De-redacts PDF's that have been redacted by drawing PDF-native rectangles over the text
# This removes ALL rectangles so might also nuke any shape diagrams a bit
# python deredactatron.py a_redacted_doc.pdf
# Outputs: deredacted-a_redacted_doc.pdf
import sys
import re
@merlinmann
merlinmann / wisdom.md
Last active April 17, 2024 21:52
Merlin's Wisdom Project (Draft)

Merlin's Wisdom Project

Or: “Everybody likes being given a glass of water.”

By Merlin Mann.

It's only advice for you because it had to be advice for me.

@danybony
danybony / screenshot_android.sh
Last active June 30, 2021 12:05
Android screenshot to current dir
#!/bin/bash
while getopts y: flag
do
case "${flag}" in
y) size=${OPTARG};;
esac
done
DEVICES=`adb devices | grep -v devices | grep device | cut -f 1`
@rock3r
rock3r / normalizeColorHex.kts
Last active February 7, 2023 17:53
A Kotlin script to normalize hex colour representations ("#RGB", "#ARGB", "#RRGGBB", "#AARRGGBB") into "#AARRGGBB", useful for when you're trying to find all unique colours in your app
/*
* ----------------------------------------------------------------------------
* "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 me a beer in return. Seb
* ----------------------------------------------------------------------------
* Feel free to attribute this code in compiled products if you feel like it,
* but it's not required.
*/
@abeppu
abeppu / feelbetter.js
Last active February 6, 2021 19:06
Implementation of @FeelBetterBot
var Twit = require("twit");
var config = require('./oauthconfig');
console.log("config:");
console.log(config);
var T = new Twit({
consumer_key: config.consumer_key,
consumer_secret: config.consumer_secret,
access_token: config.access_token,
@f2prateek
f2prateek / README.md
Created May 19, 2013 01:43
Quickly deploy Volley to your maven repository.

Quickly deploy Volley to your maven repository. Volley is a library that makes networking for Android apps easier and most importantly, faster. For an example to use Volley in your app, check out Folly.

Steps

git clone https://android.googlesource.com/platform/frameworks/volley
cd volley
(download the pom.xml)
mvn clean install
@misterbrownlee
misterbrownlee / jenkins-notes.md
Created September 12, 2012 18:10
Jenkins setup

I just had to set up Jenkins to use GitHub. My notes (to myself, mostly):

Detailed Instructions

For setting up Jenkins to build GitHub projects. This assumes some ability to manage Jenkins, use the command line, set up a utility LDAP account, etc. Please share or improve this Gist as needed.

Install Jenkins Plugins

@romannurik
romannurik / button_bar_layout.xml
Created April 10, 2012 04:24
How to make a proper button bar on ICS
<!--
A button bar is a set of buttons at the bottom of an activity.
An example is an AlertDialog with OK/Cancel buttons.
Note that something similar can be accomplished using a
split action bar and text-only action buttons, but this is an
alternate presentation that's often preferred.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
@Pretz
Pretz / gist:822036
Created February 11, 2011 07:09
xAuth in Android for Instapaper using Signpost
protected String[] doInBackground(String... credentials) {
String consumer_secret = mActivity.getString(R.string.oauth_consumer_secret);
HttpClient client = new DefaultHttpClient();
HttpPost request = new HttpPost("https://www.instapaper.com/api/1/oauth/access_token");
CommonsHttpOAuthConsumer consumer = new CommonsHttpOAuthConsumer(mActivity.getString(R.string.oauth_consumer_key),
consumer_secret);
List<BasicNameValuePair> params = Arrays.asList(
new BasicNameValuePair("x_auth_username", credentials[0]),
new BasicNameValuePair("x_auth_password", credentials[1]),
new BasicNameValuePair("x_auth_mode", "client_auth"));