Skip to content

Instantly share code, notes, and snippets.

View kennydude's full-sized avatar

Joe Simpson kennydude

View GitHub Profile
@kennydude
kennydude / microgallery.md
Last active September 27, 2015 19:34
microgallery

Microgallery

Microgallery is the newer and better version of newb. Sadly it is slightly bigger (18kb vs 12kb) but it's got a few more features.

Could be better, but it does the job for me :)

  • OOP design
  • Darker oooh
  • Mass updater
  • Descriptions!
@kennydude
kennydude / FlushCheckBoxPreference.java
Created December 4, 2011 12:25
Default Value flushable preferences in Android
import android.content.Context;
import android.preference.CheckBoxPreference;
import android.util.AttributeSet;
public class FlushCheckBoxPreference extends CheckBoxPreference implements FlushPreferences {
public FlushCheckBoxPreference(Context context, AttributeSet a) {
super(context, a);
}
@kennydude
kennydude / README.markdown
Created December 15, 2011 19:05
MCP Modifications

Hi, I have made some changes to MCP http://mcp.ocean-labs.de/

If you apply my changes, what you can do is:

  • Make a mods/YOURNAME folder and place any new Java files or PNG sprites and they will automatically work in Minecraft
  • Enable/Disable these folders

In the config, the mod called "kennydude" is switched on.

There is probably a lot to be changed (for example, I pulled in JSON parsing which may not be what you want).

@kennydude
kennydude / videoview.html
Created March 19, 2012 14:53
Video view for Tumblr
<!DOCTYPE HTML>
<html>
<!-- Copied from David Karp. David, you're sexy and you know it so please don't delete it. -->
<head>
<script type="text/javascript">
// Configuration
var tag = 'big pictures';
var batch_size = 10;
</script>
@kennydude
kennydude / README.markdown
Created April 12, 2012 19:48
Glyphicons Index

Simple,

Place the php file under the glyphicons directory (not the halflings) and then add that to a webserver (I just symlink the glyphicons directory under /var/www)

And tada! :D

@kennydude
kennydude / README.markdown
Created June 5, 2012 19:00
YouTube Manual View

You need to put this on a webserver locally

  • No login, so insecure

  • AJAX refreshing

  • No shit, just subscriptions

  • Add bootstrap into it's directory to make it look respectable

The script needs access to files:

@kennydude
kennydude / README.markdown
Created June 9, 2012 14:18
University course pulers

Usage:

Call with python uni.py on the command line and it will ask the university. Then follow on-screen instructions

Supported:

  • Newcastle University (ncl). Should work for all courses, only tested on Computing
  • Birmingham University Computing School. Only this department because of the way it's organized

Will output in plain unstyled HTML with each module's Aims and Syllabus instead of manually doing it.

@kennydude
kennydude / Activity.java
Created August 29, 2012 13:43
ProgressBar in ActionBar
public boolean onCreateOptionsMenu(final Menu menu) {
// Inflate Layout here
// ProgressBar
if(isRefreshing){
ProgressBar p = new ProgressBar(this, null, android.R.attr.progressBarStyleSmall);
menu.findItem(R.id.refreshAction).setActionView(p).setEnabled(false);
}
// Do other crazy stuff here
@kennydude
kennydude / tumblr-unac.html
Created September 29, 2012 20:24
tumblr-unac.html
<div class="uac" style="background: #333; opacity: 0.9; position: absolute; top:0;left:0;bottom:0;right:0;display:none">
</div>
<div style="position: fixed; top: 50px; right: 0; left: 0; z-index: 999999999;display:none" class="uac">
<div style="background:#fff; margin: 0 auto; text-align: center; width:500px">
<h1>YOU ARE</h1>
<img src="http://25.media.tumblr.com/tumblr_mb4mphniug1qlqeu2o1_500.gif" />
</div></div>
<script type="text/javascript" src="http://code.jquery.com/jquery.js"></script>
<script type="text/javascript">
@kennydude
kennydude / FragmentAdapter.java
Created July 28, 2012 18:07
FragmentAdapter Example
import java.util.ArrayList;
import java.util.List;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.view.ViewPager;
import android.util.Log;
import android.view.ViewGroup;