Skip to content

Instantly share code, notes, and snippets.

@flesser
flesser / bing.xml
Last active July 20, 2016 06:46
sailfish-browser default search plugins (from Jolla Tablet) - /usr/lib/mozembedlite/chrome/embedlite/content/
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
<ShortName>Bing</ShortName>
<Description>Bing. Search by Microsoft.</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width="16" height="16">data:image/x-icon;base64,AAABAAIAEBAAAAAAAAD/AAAAJgAAACAgAAAAAAAA+AMAACUBAACJUE5HDQoaCgAAAA1JSERSAAAAEAAAABAIBgAAAB/z/2EAAADGSURBVDjLY/i/TPQ/JZiBOgZsd/z/f08AhCbLgJdH/4MBiKaaAWtUIK4i4DJUA95d/v//xsz//788+o8VPN4GMRCnATAAMuByF8IFx3NR1dxbjscAkCTI+dicDDIIBkAuxWoALs0wDLIABH5+QDIA5DeY0wmFPMhrMAA34Gw1QhAtkFAwyHWwAIZahkiJoBiAOQ1kILpmkMHIaqBRy4BiOihgYACkCBQ2IIwcrSBDkNIFZl7YaARxAShcYAaAMCxaaZOZKMAAOzkOfhyf540AAAAASUVORK5CYIKJUE5HDQoaCgAAAA1JSERSAAAAIAAAACAIBgAAAHN6evQAAAO/SURBVFjDxZRJTxRBFMfrJiC7enKJ28nEGL+AXo2J+gFcrkr0C4gLKjCAoILKIgKyjSZG40FFMephHERcLm4XVzTRi7I4DHRPL8/3qqq7q6d7ZIgRO/
@flesser
flesser / svg-compress-embedded-png.py
Last active July 1, 2017 03:19
Compress embedded png images to jpg in SVG files. (based on https://gist.github.com/jeromerobert/ff34f504acd7feb0306a)
#! /usr/bin/env python
import xml.etree.ElementTree as ET
import sys
import base64
import os
import StringIO
from PIL import Image
@flesser
flesser / owncloud_fix_apt-get_upgrade.sh
Created December 10, 2015 14:42
Since v8.2 OwnCloud stays in maintenance mode after upgrading via `apt-get upgrade`. This script "manually" runs the `occ upgrade` command if required.
#!/bin/bash
#
# ----------------------------------------------------------------------------------------------------
#
# Since v8.2 OwnCloud stays in maintenance mode after upgrading via `apt-get upgrade`.
# This script "manually" runs the `occ upgrade` command if required.
#
# USAGE
# =====
# On a Debian-based system, create a file `/etc/apt/apt.conf.d/90owncloud` with the following content:
@flesser
flesser / ScreenMusic.html
Last active August 29, 2015 14:13
Play music with the high-pitched noise some TFT monitors are emitting
<html>
<body id="text" style="margin:0;padding:0;word-wrap: break-word; font-family: monospace;display:none;">
<script>
/*
My monitor (DELL U2713H) emits an annoying high-pitched noise when displaying lots of text
on a white background. When I found out that the frequency seems to depend on the text size,
I created this little HTML/Javascript to play music on my monitor.
*/
// songs from http://blog.meyju.net/2011/07/27/beep-sounds/
axel = "beep -f 659 -l 460 -n -f 784 -l 340 -n -f 659 -l 230 -n -f 659 -l 110 -n -f 880 -l 230 -n -f 659 -l 230 -n -f 587 -l 230 -n -f 659 -l 460 -n -f 988 -l 340 -n -f 659 -l 230 -n -f 659 -l 110 -n -f 1047 -l 230 -n -f 988 -l 230 -n -f 784 -l 230 -n -f 659 -l 230 -n -f 988 -l 230 -n -f 1318 -l 230 -n -f 659 -l 110 -n -f 587 -l 230 -n -f 587 -l 110 -n -f 494 -l 230 -n -f 740 -l 230 -n -f 659 -l 460";