Skip to content

Instantly share code, notes, and snippets.

🌴
Focusing

newbyca

🌴
Focusing
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 (https://keybase.io/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:
View RunUnitTests.py
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: https://onename.io/newbyca
View designer.html
<link rel="import" href="../components/polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
@newbyca
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') :
$obj.attr('name');
}
$.validity.outputs.labellocal = {
cssClass:"error",
@newbyca
newbyca / password.coffee
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.
View password.coffee
bcrypt = require 'bcrypt'
class password
text = null
salt = null
hash = null
@saltAndHash = (text, done) ->
bcrypt.genSalt (err, salt) ->
@newbyca
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
newbyca / ListenableAsyncTask.java
Created May 9, 2012
Android ListenableAsyncTask: AsyncTask extension that lets you set an onPostExecute listener from a task's client
View ListenableAsyncTask.java
public abstract class ListenableAsyncTask<Params, Progress, Result> extends AsyncTask<Params, Progress, Result>{
@Override
protected final void onPostExecute(Result result) {
notifyListenerOnPostExecute(result);
}
private AsyncTaskListener<Result> mListener;
public interface AsyncTaskListener<Result>{
public void onPostExecute(Result result);
@newbyca
newbyca / Typefaces.java
Created Mar 12, 2012
workaround class for Android Typeface.createFromAsset memory leak
View Typefaces.java
public class Typefaces{
private static final Hashtable cache = new Hashtable();
public static Typeface get(Context c, String name){
synchronized(cache){
if(!cache.containsKey(name)){
Typeface t = Typeface.createFromAsset(
c.getAssets(),
String.format("fonts/%s.ttf", name)
@newbyca
newbyca / AnimationLooper.java
Created Mar 11, 2012
workaround class for Android animation set repeatCount problem.
View AnimationLooper.java
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.