This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xen-create-image --hostname site.se --ip XX.XX.X.XXX --dist wheezy --dir /home/xen --memory 512Mb --size 15gb --swap 1024Mb --gateway XX.XX.XX.XX --netmask 255.255.255.0 --passwd --role=udev --accounts --vifname=yourdomain --vcpus=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- /home/niklas/xen/xen-unpatched/xen/tools/ioemu-remote/hw/xen_disk.c 2013-11-28 13:22:15.000000000 +0100 | |
+++ /home/niklas/xen/xen/tools/ioemu-remote/hw/xen_disk.c 2013-11-27 11:59:23.000000000 +0100 | |
@@ -116,6 +116,31 @@ | |
/* ------------------------------------------------------------- */ | |
+static void ioreq_reset(struct ioreq *ioreq) | |
+{ | |
+ memset(&ioreq->req, 0, sizeof(ioreq->req)); | |
+ ioreq->status = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import flask | |
import jinja2 | |
app = flask.Flask(__name__) | |
my_loader = jinja2.ChoiceLoader([ | |
app.jinja_loader, | |
jinja2.FileSystemLoader('/path/to/extra/templates'), | |
]) | |
app.jinja_loader = my_loader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo 'precedence ::ffff:0:0/96 100' >> /etc/gai.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Reset rem to 10-based instead of default browser 16 */ | |
html { | |
font-size: 62.5%; | |
} | |
/* | |
Photoshop does not apply line height to the first row, which CSS does. This creates all kinds of havock. | |
To calculate the correct offset for the first line we need the font-size and the lineheight, i.e: | |
@include line-height(22,30); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TO MP4 (with quicktime/windows media player support) | |
# Convert to 720 MP4 (roughly 7MB for 30 seconds) | |
ffmpeg -i input.mp4 -s hd720 -c:v libx264 -crf 23 -c:a aac -strict -2 -pix_fmt yuv420p output.mp4 | |
# Convert to 1080 MP4 (roughtly 60MB for 30 seconds) - high resolution, but not RAW | |
ffmpeg -i input.mp4 -s hd1080 -c:v libx264 -crf 23 -c:a aac -strict -2 -pix_fmt yuv420p output.mp4 | |
# Animated gif to mp4 | |
ffmpeg -i input.gif -strict -2 -pix_fmt yuv420p output.mp4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Signal strength: | |
while x=1; do /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | grep agrCtlRSSI | awk '{print "Signal strength: "$2}' ; sleep 0.5; done | |
# BSSID | |
while x=1; do /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | grep BSSID; sleep 0.5; done | |
# Speed | |
ping www.google.se |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from xattr import xattr | |
from sys import argv, stderr | |
directory = './walker' | |
child_was_empty = None | |
last_depth = None | |
#from https://github.com/danthedeckie/display_colors/blob/master/display_colors.py |