Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@janantala
janantala / getViewportSize.js
Created March 16, 2012 19:51 — forked from scottjehl/getViewportSize.js
Reliably get viewport dimensions in JS
/*!
An experiment in getting accurate visible viewport dimensions across devices
(c) 2012 Scott Jehl.
MIT/GPLv2 Licence
*/
function viewportSize(){
var test = document.createElement( "div" );
test.style.cssText = "position: fixed;top: 0;left: 0;bottom: 0;right: 0;";
@janantala
janantala / iOS scaling fix
Created November 21, 2012 10:53
iOS scaling fix, iOS version < 6
<meta name="viewport" content="width=device-width initial-scale=1.0">
<script>
// iOS scaling fix
// By @mathias, @cheeaun and @jdalton
(function(e){var c="addEventListener",b="gesturestart",g="querySelectorAll",f=[1,1],d=g in e?e[g]("meta[name=viewport]"):[];function a(){d.content="width=device-width,minimum-scale="+f[0]+",maximum-scale="+f[1];e.removeEventListener(b,a,true)}if((d=d[d.length-1])&&c in e){a();f=[0.25,1.6];e[c](b,a,true)}}(document));
</script>
@janantala
janantala / Engadget carousel
Created November 21, 2012 12:22
Engadget carousel
@janantala
janantala / gist:5875283
Created June 27, 2013 09:47
switching from ngRouter to UIRouter
https://github.com/joshdmiller/ng-boilerplate/commit/7bec0378cd6a62d90ee4af4b3f2d2186c5414968
.clear-btn {
width: 19px;
height: 19px;
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAmCAMAAACf4xmcAAAAMFBMVEWysrKysrKysrKysrKysrKysrKysrKysrKysrKysrL////39/fh4eG9vb23t7eysrKQDTJbAAAACnRSTlMBKlNxqbO70e7739UFWQAAAMFJREFUeNqNlMsOxSAIREs1AbVe/v9v78JMSn0kMytJTzqIwPWRpKxWimlOcp2U1IM07SHzSbaCor6RTta3+VZ2f6jiB5WboSIncNzKkB+yP0gHlRD/cJjCURdYPrX1F+qtPrCNP+u1Dg5UrYhSzKyBA9VCdhJtwOEICTzjx0jBNfvCLZRnpBa5SCE584WLFEpSfMOBggqJkabkFciCkOUlH4t7erKRuLYkm5wbGXIAuXHmlgO3asjFxa9BfqmSK/oPfl489V95hyMAAAAASUVORK5CYII=');
background-size: 100%;
cursor: pointer;
}
import urllib2
import re
import sys
from collections import defaultdict
from random import random
"""
PLEASE DO NOT RUN THIS QUOTED CODE FOR THE SAKE OF daemonology's SERVER, IT IS
NOT MY SERVER AND I FEEL BAD FOR ABUSING IT. JUST GET THE RESULTS OF THE
CRAWL HERE: http://pastebin.com/raw.php?i=nqpsnTtW AND SAVE THEM TO "archive.txt"
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);
@janantala
janantala / install-quake3.sh
Created September 28, 2018 07:28
Install Quake 3: Arena on a mac
#!/bin/bash
# Install Quake 3: Arena on a mac
# Copyright (c) 2016 simonewebdesign
# 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.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
CREATE TABLE rtls_session_tracks_byday (
operation_id text,
year_day text,
floor_id text,
start timestamp,
tag_id text,
sequence_number int,
positions_x frozen<list<float>>,
positions_y frozen<list<float>>,
positions_time frozen<list<timestamp>>,
CREATE TABLE rtls_session_tracks_byday (
operation_id text,
year_day text,
floor_id text,
start timestamp,
tag_id text,
sequence_number int,
positions_x list<float>,
positions_y list<float>,
positions_time list<timestamp>,