Skip to content

Instantly share code, notes, and snippets.

View gurre's full-sized avatar

Gustav Svalander gurre

  • Göteborg, Sweden
  • 15:15 (UTC +02:00)
View GitHub Profile

Keybase proof

I hereby claim:

  • I am gurre on github.
  • I am gurre (https://keybase.io/gurre) on keybase.
  • I have a public key ASDCO6KPRsTvh7hUpJAJcgGQd58YRD8us6ETmy23Ve8f1wo

To claim this, I am signing this object:

@gurre
gurre / Convert mp4 to html5 video formats
Last active June 30, 2016 20:00
Convert mp4 to html5 video formats
ffmpeg -i "movbg.mov" -b 1500k -vcodec libtheora -acodec libvorbis -ab 160000 -g 30 "movbg.ogv"
ffmpeg -i "movbg.mov" -b 1500k -vcodec libvpx -acodec libvorbis -ab 160000 -f webm -g 30 "movbg.webm"
ffmpeg -i "movbg.mov" -vcodec h264 -acodec aac -strict -2 "movbg.mp4"
@gurre
gurre / malware-list
Last active June 21, 2016 16:46
Malware domains to block in /etc/hosts
0.0.0.0 000007.ru
0.0.0.0 0000mps.webpreview.dsl.net
0.0.0.0 0001.2waky.com
0.0.0.0 024xuyisheng.com
0.0.0.0 0452jhw.com
0.0.0.0 0511zfhl.com
0.0.0.0 0532qdzxmr.com
0.0.0.0 0632qyw.com
0.0.0.0 09cd.co.kr
0.0.0.0 0fees.net
@gurre
gurre / gist:0c2f125fd919079c24b3
Created February 20, 2015 12:03
Grunt task to develop, watch, and upload to S3 using awscli
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
files: ['public/**'],
tasks: ['deploy']
},
@gurre
gurre / svtplayjson
Created March 13, 2014 13:49
Svtplay json endpoint and format
http://www.svtplay.se/rss.xml
http://www.svtplay.se/video/1886578?output=json
{
"videoId": 1886578,
"video": {
"videoReferences": [
{
"url": "http://svtplay9b-f.akamaihd.net/z/world/open/20140312/1359913-008A/UPPDRAG_GRANSKN-008A-c4ccf21435c0cce7_,900,348,564,1680,2800,.mp4.csmil/manifest.f4m",
@gurre
gurre / regex
Last active June 21, 2016 16:45
Useful regexes
<?php
define('REGEX_ALPHA',"{[A-ZÅÄÖa-zåäö\s\-]+}");
define('REGEX_ALPHANUMERIC',"{[0-9A-ZÅÄÖa-zåäö\s\-]+}");
define('REGEX_ALPHANUMERICSIGNS',"{[0-9A-ZÅÄÖa-zåäö\s\-\_\.\:\,\;\(\)\?\!\&\/\=]+}");
define('REGEX_NUMERIC',"{^(-){0,1}([0-9]+)(,[0-9][0-9][0-9])*([.][0-9]){0,1}([0-9]*)$}");
define('REGEX_DIGIT','{[0-9]+}');
define('REGEX_EMAIL',"{^[a-z0-9\å\ä\ö._-]+@[a-z0-9\å\ä\ö.-]+\.[a-z]{2,6}$}i");
define('REGEX_SWEMOBILE',"{((46)|(0))((70)|(73)|(76))([\d+]{6,7}$)}");
define('REGEX_ENCODED',"{[A-Za-z\-\_\,\*]+}");
define('REGEX_PERMALINK','{[a-z0-9\-\_]+}');
<?php
// set up terminal colorization
define('T_RESET',"\33[0m");
define('T_BLACK',"\33[0;30m");
define('T_DARKGRAY',"\33[1;30m");
define('T_BLUE',"\33[0;34m");
define('T_LIGHTBLUE',"\33[1;34m");
define('T_GREEN',"\33[0;32m");
define('T_LIGHTGREEN',"\33[1;32m");
define('T_CYAN',"\33[0;36m");
@gurre
gurre / change permissions
Created July 4, 2013 16:56
Change file permissions on file in git
git update-index --chmod=+x script.sh
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
mr Marathi
bs Bosnian
ee_TG Ewe (Togo)
ms Malay
kam_KE Kamba (Kenya)
mt Maltese
ha Hausa
es_HN Spanish (Honduras)
ml_IN Malayalam (India)
ro_MD Romanian (Moldova)
@gurre
gurre / gist:5884772
Created June 28, 2013 13:45
How to get the locale identifier in iOS
NSString *locale = [[NSLocale currentLocale] localeIdentifier];