Skip to content

Instantly share code, notes, and snippets.

Avatar

Joe Simpson kennydude

View GitHub Profile
View microgallery.md

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 / post.md
Created Sep 16, 2014
How PowerLine Works
View post.md

How Does The Powerline thing work?

I recently was enlightened to Powerlines, the cool terminal thing that looks really cool.

But, me being me I wanted to know how this thing worked, but nobody has wrote anything and I've found out.

Basically the "patched fonts" just add some symbols like arrows and git icons so they render in your terminal properly.

By Powerline, I mean this thing:

View card.css
.card{
background: #FFF;
border-radius: 2px;
border: 1px solid #ddd;
border-bottom-width: 2px;
margin-bottom: 10px;
}
View index.html
<html><head>
<meta charset="UTF-8">
<!--
Copyright (c) 2013 by Joe Simpson (http://codepen.io/kennydude/pen/CnDAz)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
@kennydude
kennydude / ExtendedEditText.java
Created Apr 17, 2013
Ever wanted a prefix and suffix on your EditText? Yes, well this ExtendedEditText class will do it for you!
View ExtendedEditText.java
package me.kennydude.spending.widgets;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.*;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.StateListDrawable;
import android.text.Editable;
import android.text.TextPaint;
import android.text.TextWatcher;
@kennydude
kennydude / class.java
Created Mar 4, 2013
Custom style *should work roughly*
View class.java
public static class BigPictureStyle extends Style {
private Bitmap mPicture;
private Bitmap mBigLargeIcon;
private boolean mBigLargeIconSet = false;
public BigPictureStyle() {
}
public BigPictureStyle(Builder builder) {
setBuilder(builder);
View gist:4953168
while(noSuccess){
try{
tryAgain();
} catch(InvalidStateException e){
break;
} catch(SleepDeprevationException e){
sleep( new Hours(8) );
} catch(DeathException e){
break;
}
View TabBackgroundDrawable.java
package me.kennydude.transtimetable.ui;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.drawable.Drawable;
import android.util.StateSet;
public class TabBackgroundDrawable extends Drawable {
View 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 / Activity.java
Created Aug 29, 2012
ProgressBar in ActionBar
View Activity.java
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