Skip to content

Instantly share code, notes, and snippets.

View jareware's full-sized avatar

Jarno Rantanen jareware

View GitHub Profile
@jareware
jareware / geotagging.md
Last active June 28, 2018 18:31
Media Geotagging and Massaging on macOS

Media Geotagging and Massaging on macOS

Synchronizing image timestamps

The one and only ExifTool will adjust the various timestamps in Exif data. Take a look at the current values:

$ exiftool DSC02833.JPG | grep Date

If this camera is behind the reference camera (that you want to sync with) by, say, 6 hours, 58 minutes and 10 seconds, add that much to each image in the dir:

@jareware
jareware / index.html
Last active August 29, 2015 14:00
A test document for spreading DOM manipulation workload across browser processes.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, height=device-height" />
<title>parallel-thrash</title>
<style type="text/css">
iframe {
width: 250px;
height: 500px;
@jareware
jareware / .bashrc
Created March 11, 2014 12:08
Personal dotfiles dump.
#!/bin/bash
# Enable "**/*.js" style globs:
shopt -s globstar
# Set PATH so it includes user's private bin if it exists:
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
@jareware
jareware / example.png
Last active August 29, 2015 13:56
Userscript for maintaining a trackbar below your last seen message in a Flowdock chat, similar to what trackbar.pl does for irssi. Runnable both as a userscript (e.g. http://tampermonkey.net/) and bookmarklet (e.g. http://en.wikipedia.org/wiki/Bookmarklet). To enjoy automatic updates with Tampermonkey, put in https://gist.github.com/jareware/885…
example.png
@jareware
jareware / input.txt
Created January 11, 2014 13:59
FRWD plaintext data file
Start Point Location (WGS-84): 60 deg 08.2151' N, 24 deg 25.6136' E
End Point Location (WGS-84): 60 deg 09.8770' N, 24 deg 25.4427' E
Route data:
Time (s) Laptime North-South (m) East-West (m) Altitude (m) Speed (km/h) Distance (m) Heart Rate (bpm) Temperature (celsius) Pressure (mbar) Pitch angle (deg)
0 Yes 2753 9234 58,0 4,2 0 96 23,2 1004,1 -0,0
1 2754 9235 58,0 4,2 1 97 23,2 1004,1 -0,0
2 2754 9236 58,0 4,3 2 97 23,2 1004,1 -0,0
3 2755 9237 58,0 4,3 4 97 23,2 1004,0 -0,0
4 2755 9238 58,0 4,4 5 97 23,2 1003,8 -0,0
@jareware
jareware / gist.md
Last active January 30, 2024 03:15
Project-specific lint rules with ESLint

⇐ back to the gist-blog at jrw.fi

Project-specific lint rules with ESLint

A quick introduction

First there was JSLint, and there was much rejoicing. The odd little language called JavaScript finally had some static code analysis tooling to go with its many quirks and surprising edge cases. But people gradually became annoyed with having to lint their code according to the rules dictated by Douglas Crockford, instead of their own.

So JSLint got forked into JSHint, and there was much rejoicing. You could set it up to only complain about the things you didn't want to allow in your project, and shut up about the rest. JSHint has been the de-facto standard JavaScript linter for a long while, and continues to do so. Yet there will always be things your linter could check for you, but doesn't: your team has agreed on some convention that makes sense for them, but JSHint doesn't have an option

@jareware
jareware / gist:7113618
Last active December 26, 2015 07:09
Returning ASAP in AMD modules
define([ 'lib/foo' ], function(foo) {
var MY_CONST = 123;
var myModuleState = 'derp';
return {
bar: bar,
baz: baz
};
@jareware
jareware / gist.md
Last active June 7, 2018 04:16
Backporting Compass flexbox mixins from bleeding-edge (0.13.alpha.4) to current stable (0.12.2)

⇐ back to the gist-blog at jrw.fi

New Compass flexbox mixins

The current Compass bleeding-edge (0.13.alpha.4) contains awesome new flexbox mixins that allow you to generate styling for all three (!) past and current specifications. See http://css-tricks.com/using-flexbox/ for the details behind the careful interweaving of different properties and prefixes, but the beef is support for:

  • Chrome any
  • Firefox any
  • Safari any
  • Opera 12.1+
@jareware
jareware / index.html
Last active December 16, 2015 16:49
CSS calc() function.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, height=device-height"/>
<title>CSS calc() function</title>
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css" rel="stylesheet">
<style type="text/css">
code {
color: black;
@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