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
@ryanbateman
ryanbateman / unfliptable.coffee
Last active June 30, 2016 13:49
Hubot "Unflip a table" script
# Description:
# Listen for any table flips, clean up afterwards
#
# Author:
# @rynbtmn
module.exports = (robot) ->
robot.hear /┻━┻/i, (res) ->
res.send "┬─┬ノ( º _ ºノ)"
### Keybase proof
I hereby claim:
* I am ryanbateman on github.
* I am ryanbateman (https://keybase.io/ryanbateman) on keybase.
* I have a public key whose fingerprint is 28BD 3445 A837 A715 BB9E 0699 7320 CC6E 330F C2A1
To claim this, I am signing this object:
@ryanbateman
ryanbateman / appsearch.coffee
Last active August 29, 2015 14:00
A Hubot script to quickly search for an Android app and provide a Playstore link if it exists
# Description:
# Quickly look up an Android application using 42Matters search
#
# Configuration:
#
# HUBOT_42MATTERS_ACCESS_TOKEN - the access token required for API accesss
#
# Commands:
# hubot app - Replies with the first result from an app search on 42Matters API
#
@ryanbateman
ryanbateman / underground.coffee
Last active August 29, 2015 14:00
Hubot Underground status
# Description:
# See the current list of delays or incidents on the London Underground
#
# Dependencies:
# "cheerio": "0.12.1"
#
# Commands:
# hubot tube - Replies with a list of current incidents/delays on the London Underground
#
@ryanbateman
ryanbateman / gist:6667995
Last active September 6, 2017 21:03
Basic BlurTransformer for Square's Picasso
import android.content.Context;
import android.graphics.Bitmap;
import android.renderscript.Allocation;
import android.renderscript.Element;
import android.renderscript.RenderScript;
import android.renderscript.ScriptIntrinsicBlur;
import com.squareup.picasso.Transformation;
public class BlurTransform implements Transformation {
@ryanbateman
ryanbateman / gist:5643826
Created May 24, 2013 14:17
Log out a Volley request as a curl command
private void logToCurlRequest(Request<?> request) {
StringBuilder builder = new StringBuilder();
builder.append("curl request: curl ");
builder.append("-X \"");
switch (request.getMethod()) {
case Method.POST:
builder.append("POST");
break;
case Method.GET:
builder.append("GET");
@ryanbateman
ryanbateman / GsonObjectRequest.java
Last active December 17, 2015 14:39
An attempt at a GsonObjectRequest that will post and return objects using Volley
package com.example.network.requests;
import java.io.UnsupportedEncodingException;
import java.util.Map;
import com.android.volley.AuthFailureError;
import com.android.volley.NetworkResponse;
import com.android.volley.ParseError;
import com.android.volley.Request;
import com.android.volley.Response;
for filename in *.RW2 ; do dcraw -c -w -v $filename | pnmtopng > pngs/$filename.png ; done
convert *.png -resize 50% -set filename:f '%t_magnify.%e' +adjoin '%[filename:f]'
@ryanbateman
ryanbateman / gist:3899841
Created October 16, 2012 15:06
Round and frame an image
public static Bitmap round(Context context, Bitmap source) {
// Use the height and width of our source image as a basis
int width = source.getWidth();
int height = source.getHeight();
Paint paint = new Paint();
paint.setAntiAlias(true);
paint.setColor(WHITE);
@ryanbateman
ryanbateman / gist:3237379
Created August 2, 2012 14:17
Useful emoticons
ಠ▃ಠ
ಠ_ರೃ
ಥ_ಥ