Skip to content

Instantly share code, notes, and snippets.



Block or report user

Report or block newbyca

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:cd12c35ad9f4b119e438
### Keybase proof
I hereby claim:
* I am newbyca on github.
* I am newbyca ( on keybase.
* I have a public key whose fingerprint is 0B8C 4093 7CB9 E9A3 71E5 B3C3 159C 2A4E CB90 3235
To claim this, I am signing this object:
import os
import fnmatch
import unittest
import webapp2
import importlib
from time import clock
class RunUnitTests(webapp2.RequestHandler):
def get(self):
View gist:2e58c0379f5fcdecf8c1
Verifying that +newbyca is my Bitcoin username. You can send me #bitcoin here:
View designer.html
<link rel="import" href="../components/polymer/polymer.html">
<polymer-element name="my-element">
:host {
position: absolute;
width: 100%;
height: 100%;
newbyca / jquery.validity.chosen.js
Created Jul 17, 2012
custom Validity outputMode that handles Chosen <select> controls
View jquery.validity.chosen.js
(function($) {
function getIdentifier($obj) {
return $obj.attr('id').length ?
$obj.attr('id') :
$.validity.outputs.labellocal = {
newbyca /
Created Jun 17, 2012
a password class i'm using in my nodejs project. i decided this abstraction was appropriate given a desire to create password hashs asyncly.
bcrypt = require 'bcrypt'
class password
text = null
salt = null
hash = null
@saltAndHash = (text, done) ->
bcrypt.genSalt (err, salt) ->
newbyca / tickersetup.js
Created May 31, 2012
setup script for google finance ticker
View tickersetup.js
$(document).ready(function () {
$('div#ticker').googlefinanceticker({ tickers: 'goog,aapl,msft,csco,intc,ibm,att,bidu' });
newbyca /
Created May 9, 2012
Android ListenableAsyncTask: AsyncTask extension that lets you set an onPostExecute listener from a task's client
public abstract class ListenableAsyncTask<Params, Progress, Result> extends AsyncTask<Params, Progress, Result>{
protected final void onPostExecute(Result result) {
private AsyncTaskListener<Result> mListener;
public interface AsyncTaskListener<Result>{
public void onPostExecute(Result result);
newbyca /
Created Mar 12, 2012
workaround class for Android Typeface.createFromAsset memory leak
public class Typefaces{
private static final Hashtable cache = new Hashtable();
public static Typeface get(Context c, String name){
Typeface t = Typeface.createFromAsset(
String.format("fonts/%s.ttf", name)
newbyca /
Created Mar 11, 2012
workaround class for Android animation set repeatCount problem.
import android.view.View;
import android.view.ViewTreeObserver.OnGlobalLayoutListener;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.Animation.AnimationListener;
public class AnimationLooper{
public static void start(final View v, final int animationResId){
v.getViewTreeObserver().addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
You can’t perform that action at this time.