Skip to content

Instantly share code, notes, and snippets.

1977 - A New Hope
1978 - Dawn of the Dead
1979 - Alien
1980 - The Empire Strikes Back
1981 - Escape from New York
1982 - Blade Runner
The Thing
1983 - Return of the Jedi
1984 - Ghostbusters
The Terminator
@twaddington
twaddington / modtime.py
Created January 2, 2017 05:41
Script to update file modification and access times. Unfortunately, does not update file creation time.
#!/usr/bin/python
import sys
import os
import time
from datetime import datetime
def modtime(path):
print path
/*
* Copyright (C) 2017 Simple Finance Technology Ltd.
*
* 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
:Mobile-Android:crashlyticsCleanupResourcesDebug
ERROR - Crashlytics Developer Tools error.
java.net.UnknownHostException: api.crashlytics.com: nodename nor servname provided, or not known
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:901)
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1293)
at java.net.InetAddress.getAllByName0(InetAddress.java:1246)
at java.net.InetAddress.getAllByName(InetAddress.java:1162)
at java.net.InetAddress.getAllByName(InetAddress.java:1098)
at com.crashlytics.reloc.org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:44)
@twaddington
twaddington / gist:8035951
Created December 19, 2013 08:11
Fetch the Activity title from the Android manifest
try {
ActivityInfo activityInfo = getPackageManager().getActivityInfo(getComponentName(), 0);
setTitle(activityInfo.labelRes);
} catch (NameNotFoundException e) {
SFLog.w(String.format("%s is not a valid Activity", getComponentName()));
}
@twaddington
twaddington / charities.md
Created December 12, 2013 19:15
Charitable Giving
@twaddington
twaddington / gist:7819524
Last active December 30, 2015 10:59
Cropping screens for Google Play

Google Play

You can easily use ImageMagick to strip the status and navigation bar off of your Google Play images.

Nexus 5

# Top and bottom
$ convert screen.png -crop +0+76 -crop +0-145 +repage screen_crop.png

Bottom only

/*
* Copyright 2013 Simple Finance Corporation. All rights reserved.
*
* 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
@twaddington
twaddington / HttpUtils.java
Last active December 28, 2015 20:39
Create a sane user agent string for network enabled Android applications.
/*
* Copyright 2013 Tristan Waddington. All rights reserved.
*
* 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
@twaddington
twaddington / gist:5862667
Created June 25, 2013 21:37
Samsung Galaxy S4 - Camera supported picture sizes
D/Simple (23737): 4128x3096
D/Simple (23737): 4128x2322
D/Simple (23737): 3264x2448
D/Simple (23737): 3264x1836
D/Simple (23737): 2048x1536
D/Simple (23737): 2048x1152
D/Simple (23737): 1280x720
D/Simple (23737): 640x480