Skip to content

Instantly share code, notes, and snippets.

@bivald
bivald / hide-fixed-on-zoom.html
Last active December 21, 2015 20:49
Hide a fixed element (navigation/menu) on zoom (so iOS doesn't distort or alter the menu). iOS could use gesture as well, but touch *should* work better for Android as well. UPDATE: Haven't tried Android, so added an if iOS check
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Never Denim</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
@bivald
bivald / ie9-console-fix.js
Created August 22, 2013 19:24
Avoid `console` errors in browsers that lack a console.
// Source: https://github.com/h5bp/html5-boilerplate/blob/master/js/plugins.js
// Avoid `console` errors in browsers that lack a console.
(function() {
var method;
var noop = function () {};
var methods = [
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
*, *:before, *:after {
-moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;
}
curl https://dl.dropboxusercontent.com/u/78509419/munin-html > /usr/share/munin/munin-html
@bivald
bivald / convertmovtomp4.sh
Created June 14, 2013 13:23
Convert mov to 720p mp4, chrome/iphone compatible
find ./ -iname "*Demo-Master.mov" -exec ./ffmpeg -i {} -c:v libx264 -preset slower -b:v 2500k -b:a 196k -vf scale=-1:720 -pix_fmt yuv420p {}.ffmpeg.mp4 ";" -ls
@bivald
bivald / debian-networking-dom0-xen-wheezy.md
Last active September 17, 2021 13:12
Debian wheezy networking bridge, xen
/*// =======================================================
The Retro Affect Animation Exporter
Created: January 6th, 2010
______________________________________________________________________________
Authors:
Peter Jones
David Carrigg
The function getFrame(IO) is by:
jugenjury from ps-scripts.com
@bivald
bivald / webfont-rendering-fix.css
Created December 19, 2012 11:00
Cross-browser fix for bad web font rendering. http://www.dropmocks.com/mBnnKJ (left is before, right is after)
/*
Safari and Chrome (os x) both handles webfonts badly when compared
with the Photoshop version of the same font. They are generally harder and rough.
Example:
http://www.dropmocks.com/mBnnKJ
Left: Web font in Safari, Right: Fixed web font
@bivald
bivald / clean-raspberry.sh
Created December 1, 2012 15:19
Clean Raspberry Pi Debian
#!/bin/bash
sudo apt-get --yes purge xserver* x11-common x11-utils x11-xkb-utils x11-xserver-utils xarchiver xauth xkb-data console-setup xinit lightdm libx{composite,cb,cursor,damage,dmcp,ext,font,ft,i,inerama,kbfile,klavier,mu,pm,randr,render,res,t,xf86}* lxde* lx{input,menu-data,panel,polkit,randr,session,session-edit,shortcut,task,terminal} obconf openbox gtk* libgtk* alsa* nano python-pygame python-tk python3-tk scratch tsconf
sudo apt-get -y purge aspell hunspell-en-us iptraf libaspell15 libhunspell-1.2-0 lxde lxsession lxtask lxterminal squeak-vm whiptail zenity gdm gnome-themes-standard python-pygame
apt-get --yes purge xdg-tools desktop-file-utils omxplayer python3-numpy python3
sudo apt-get remove xserver-xorg
sudo apt-get purge ^lx
sudo apt-get --yes autoremove
sudo apt-get --yes autoclean
sudo apt-get --yes clean
@bivald
bivald / xrf-brute-force.py
Created November 25, 2012 16:53
XRF Getting out of sleep mode - brute force
#!/usr/bin/python
# This is a crude brute-force tool to remove the cycling on a XRF module (http://shop.ciseco.co.uk/xrf-wireless-rf-radio-uart-rs232-serial-data-module-xbee-shape-arduino-pic-etc/)
# What it does is that every 20 ms it sends out a : WAKE + REMOVE INTLV + Reboot command
# This should be running when you power up your XRF (or when the XRF sends the battery reading, but on startup is easier)
#
# Start the script, start the XRF and it should reset straight away. Afterwards it will boot with the regular STARTED commands, without cycle.
# Everything else is the same (i.e device name etc.)
#
# 1. You need a XRF connected to your computer,
# Either a USB XRF receiver/sender(http://shop.ciseco.co.uk/urf-radio-module-and-serial-inteface-via-usb/)