Skip to content

Instantly share code, notes, and snippets.

View mrflix's full-sized avatar

Felix Niklas mrflix

View GitHub Profile
@mrflix
mrflix / gist:1010898
Created June 6, 2011 19:27
Lion Mail 3d Animation
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Lion Mail 3d Animation</title>
<style type="text/css">
body {
font: 12px/15px "Helvetica Neue", sans-serif;
background: #adb0b8;
}
@mrflix
mrflix / index.html
Last active October 19, 2015 16:52
svgstore fallback
<!-- svgstore fallback -->
<script>
/*
detect if browser is
- Chrome 14-20
- Android Browser 4.1+
- iOS 6-7
- Safari 6
- Edge 12
- IE 9-11
@mrflix
mrflix / soundfinder.js
Created September 12, 2013 14:25
Soundfinder Bookmarklet
// MIT License
// by @mrflix
(function(){
// Template Matching algorithm using correlation coeffizient
// http://en.wikipedia.org/wiki/Template_matching
// learned at HTW Berlin tought by Prof. Dr. Kai Uwe Barthel
function getCorrelationCoeffizient(data1, data2){
var sumI = 0, sumI2 = 0, sumIR = 0, sumR = 0, sumR2 = 0;

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@mrflix
mrflix / mediancut.js
Last active May 17, 2021 16:02
A implementation of the median cut algorithm to cluster the colors in an image.
// data = ctx.getImageData(0, 0, image.width, image.height).data;
//
// mediancut(data, colorCount);
// returns [[255,55,255], [233,34,233], [144,34,233], [89,34,233]];
function mediancut(data, n){
var boxes = [getBoundingBox(data)];
if(n !== 1){
boxes = cut(boxes[0]);
while(boxes.length < n){
@mrflix
mrflix / OrbitControls.js
Last active November 29, 2021 02:44
Three.OrbitControls for multiple instances on a page.Usage: controls = new THREE.OrbitControls(camera, document, renderer.domElement); Based on: http://threejs.org/examples/js/controls/OrbitControls.js
/**
* @author qiao / https://github.com/qiao
* @author mrdoob / http://mrdoob.com
* @author alteredq / http://alteredqualia.com/
* @author WestLangley / http://github.com/WestLangley
* @author erich666 / http://erichaines.com
* @author mrflix / http://felixniklas.de
*
* released under MIT License (MIT)
*/
# site/blueprints/files/default.yml
title: Datei
accept:
maxwidth: 15000
maxheight: 15000
columns:
- width: 1/2
fields:
focus:
label: Fokuspunkt
@mrflix
mrflix / media.php
Last active November 9, 2022 19:41
/* site/snippets/media.php */
<? if($media): ?>
<?
$fullMediaClass = 'media-entry';
$fullCaptionClass = 'media-caption';
if(isset($class)){
$mediaClass = explode(' ', $class)[0];
$fullMediaClass .= " $mediaClass-element";
$fullCaptionClass .= " $mediaClass-caption";
}
@mrflix
mrflix / ffmpeg-imagemagick-receipts.txt
Created December 30, 2022 10:25
ffmpeg & imagemagick receipts
convert for html5: ffmpeg -i "einladungsvideo-roh.mp4" -acodec aac -strict -2 -vcodec libx264 -vb 2500k -pix_fmt yuv420p -movflags +faststart -f mp4 "einladungsvideo.mp4"
high quality mp4: ffmpeg -i $1 -acidic aac -vcodec libx264 -vb 8000k -f mp4 $file.hq.mp4
mov to gif: ffmpeg -i in.mov -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > out.gif
cut movie: ffmpeg -i 170208_KK_REELv03_.mp4 -ss 00:00:05 -c copy -to 00:01:10 kk_reel.mp4
scale down: ffmpeg -i zign-gif-women.mp4 -vf scale=640:-1 zign-women@640.mp4
screenshot: ffmpeg -i EKD_Schiffe_WEB.mp4 -qscale:v 5 -frames:v 1 ekd-schiffe-poster3.jpg
screenshot at time: ffmpeg -ss 00:03:30 -i helen-keller-2.4.mp4 -qscale:v 5 -frames:v 1 helen-keller-2.4.mp4.jpg
screenshot all: for i in *.mp4; do ffmpeg -n -i "$i" -qscale:v 8 -frames:v 1 "${i%}.jpg"; done
oder ffmpeg -ss 00:00:15 -i PE_Erklärfilm_26.02.mp4 -vframes 1 -q:v 2 poster.jpg
zuschneiden: ffmpeg -i in.mp4 -filter:v "crop=in_w/2:in_h/2:in_w/2:in_h/2" -c:a copy out.mp4