Skip to content

Instantly share code, notes, and snippets.

View tobiastom's full-sized avatar

Tobias Tom tobiastom

View GitHub Profile
var player = document.querySelector('.html5-video-player');
var video = player.querySelector( 'video' );
player.parentNode.replaceChild( video, player );
video.controls = true;

It all comes down to trust

I had an awkward experience today. I downloaded an update for an app. I got excited about the excellent stuff they have done to their previous version and I really do love the app. Then I thought to myself: that's just too good to be true. It kind of was.

What did happen

I'm using an OS X Server for my mails, calendar, contacts, messages, wiki, VPN, whatever. You may like it or not, but it's a self hosted server which makes it easy for almost everyone to host their own stuff.

As paranoid as I am, as naive I can be. I did trust that application. I don't know anyone behind the app personally, but they seem to be some nice folks. I instantly logged myself into my jabber server with a username and a password in the believe that the password will stay on my device.

Beside other nice things the application provides a feature with which you can stay online, even after Apple has terminated the application (after a maximum of ten minutes, which can be quite annoying for a permanent

@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active June 16, 2024 13:44
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@tobiastom
tobiastom / Readme.md
Last active December 23, 2015 21:19
Clone all repositories from a remote SSH server.

Backup repositories

The idea of this script is to backup all repositories from a remote SSH server.

It will search for ´.git´ directories inside the home directory of the "git" user. By default it is the current user, but can be configured by changing the $GIT_USER variable at the top of the script.

All repositories will be cloned into the current working directory.

If there is a previous clone of the repository at the given destination, it will obviously only make a new pull.

@tobiastom
tobiastom / iTunes Jump Back.scpt
Created May 10, 2011 08:26
AppleScript to jump back for some seconds in iTunes
tell application "iTunes"
if player state is playing then
set jumpInSeconds to 20
set currTime to get player position
if currTime < jumpInSeconds then
set currSkip to 0
else
set currSkip to currTime - jumpInSeconds
end if
@gruber
gruber / Liberal Regex Pattern for All URLs
Last active May 29, 2024 00:03
Liberal, Accurate Regex Pattern for Matching All URLs
The regex patterns in this gist are intended to match any URLs,
including "mailto:foo@example.com", "x-whatever://foo", etc. For a
pattern that attempts only to match web URLs (http, https), see:
https://gist.github.com/gruber/8891611
# Single-line version of pattern:
(?i)\b((?:[a-z][\w-]+:(?:/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))