Skip to content

Instantly share code, notes, and snippets.

@byteface
byteface / gist:8ee9cdc774d74d61a0d5
Created September 22, 2014 02:30
reload page javascript
setTimeout( function(){ windowReload() }, 2000 );
function windowReload(){
if(!window.location.hash) {
window.location = window.location + '#loaded';
window.location.reload();
}else{
if (history && history.pushState){
history.pushState( null, null, window.location.href.split('#')[0] );
}
}
@byteface
byteface / gist:8250195
Created January 4, 2014 01:21
Learning python / mucking about. Built an obj like an array but with negative index positions. index's can now be a value (i.e for rank). My first gist :)
class RankArray(object):
"""An array with negative index positions"""
average=None
pos=[]
neg=[]
def __init__(self,average,pos,neg):