Skip to content

Instantly share code, notes, and snippets.

View jareware's full-sized avatar

Jarno Rantanen jareware

View GitHub Profile
@jareware
jareware / logger.js
Last active June 7, 2018 04:16
Simple utility for unified logging to the console, with optional timestamping.
/**
* Simple utility for unified logging to the console, with optional timestamping.
*
* @example // Create several loggers around the application:
* var log = logger.create('main');
* var logInAnotherModule = logger.create('anotherModule');
*
* // Call the created loggers:
* log('Application started');
* logInAnotherModule('Module started');
@jareware
jareware / label-timelapse.sh
Created December 3, 2012 07:18
Generates a "label image" for each JPEG matching INPUT_GLOB, writing them to OUTPUT_DIR.
#!/bin/bash
# Generates a "label image" for each JPEG matching INPUT_GLOB, writing them to OUTPUT_DIR.
# The labels contain the (possibly adjusted) timestamp of the EXIF tag of the input image.
# As the backgrounds are transparent, they can be overlaid on a timelapse, for example.
# Requires: exiftool imagemagick
INPUT_GLOB="*.JPG"
OUTPUT_DIR="labels"
@jareware
jareware / index.html
Created November 28, 2012 11:51 — forked from omahlama/index.html
Frontend/UX friendship without limits scratchpad
<!DOCTYPE html>
<html>
<head>
<title>Frontend/UX friendship without limits scratchpad</title>
<meta charset="utf-8">
<!-- Include Twitter Bootstrap CSS -->
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap.min.css" rel="stylesheet">
@jareware
jareware / index.html
Created November 27, 2012 11:04
Frontend/UX friendship without limits scratchpad
<!DOCTYPE html>
<html>
<head>
<title>Frontend/UX friendship without limits scratchpad</title>
<meta charset="utf-8">
<!-- Include Twitter Bootstrap CSS -->
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap.min.css" rel="stylesheet">
@jareware
jareware / gist:4130827
Created November 22, 2012 12:08
HTML5DevConf - October 2012 - Executive Summary

HTML5DevConf - October 2012 - Executive Summary

Source: http://www.youtube.com/playlist?list=PLAIXSzgkhDs7gu24tYyS432v4AGZwPc8I&feature=plcp

Seamless iFrames: The Future, Today! - with Ben Vinegar from Disqus

@jareware
jareware / gist:3197529
Created July 29, 2012 10:49
Google Maps API async loading w/ require.js 2.0
// lib/google-maps-loader.js
define({
load: function(name, require, load, config) {
var callback = 'maps_loader_' + new Date().getTime();
window[callback] = function() {
load(window.google);
};
@jareware
jareware / desc
Created February 7, 2012 07:55 — forked from nnarhinen/desc
addAllFoo:sta kun kutsutaan, niin this.somProperty.doSOmething() feilaa, koska "window" -objektilla ei ole propertya "someProperty"
app = window.app || {};
(function(exports) {
var importedStuff = app.anotherModule.something;
exports.method = function() {};
})(app.module = {});
@jareware
jareware / gist:1084619
Created July 15, 2011 12:51
Waiting for a specific DOM event in Jasmine
/**
* Pauses the tests execution until the named event is notified on the given
* element, or a timeout is reached.
*
* @param event
* @param onElement
* @param timeout
*/
var waitsForEvent = function(event, onElement, timeout) {