Skip to content

Instantly share code, notes, and snippets.

View jareware's full-sized avatar

Jarno Rantanen jareware

View GitHub Profile
@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) {
app = window.app || {};
(function(exports) {
var importedStuff = app.anotherModule.something;
exports.method = function() {};
})(app.module = {});
@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"
@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 / 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 / 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 / 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 / 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 / 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 / SCSS.md
Last active April 23, 2024 22:13
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso