Skip to content

Instantly share code, notes, and snippets.

@slawekkolodziej
slawekkolodziej / touch-tooltip-fix.js
Created June 24, 2012 14:26
Highcharts tracker now don't prevent default behavior (like scrolling on touch devices).
Highcharts.Chart.prototype.callbacks.push(function(chart) {
var hasTouch = document.documentElement.ontouchstart !== undefined,
mouseTracker = chart.tracker,
container = chart.container,
mouseMove;
mouseMove = function (e) {
// let the system handle multitouch operations like two finger scroll
// and pinching
if (e && e.touches && e.touches.length > 1) {
@slawekkolodziej
slawekkolodziej / file2data
Created August 20, 2011 18:54
Command line ruby script that converts binary files to html5 data uri (requires ruby 1.9)
#!/usr/bin/env ruby
require 'Base64'
require 'mime/types'
ARGV.each do |file|
puts ['File: ', file].join
puts [(MIME::Types.of file)[0], ';base64,', (Base64::encode64 (File.read file)).gsub("\n", "") ].join if FileTest::exist? file
puts "\n"
end