Skip to content

Instantly share code, notes, and snippets.

View stefanfisk's full-sized avatar

Stefan Fisk stefanfisk

  • Stockholm, Sweden
View GitHub Profile
@Steve-Tech
Steve-Tech / codec-reader.py
Last active February 12, 2024 12:35
Codec Reader for HTML Video Tags, gets the correct codecs parameter for AV1 and H.264 videos.
import json
import mimetypes
import subprocess
import sys
# Codec Reader for HTML Video Tags by Steve-Tech
# Usage: python3 codec-reader.py [-d] file_name
# Requires ffmpeg and ffprobe to be installed.
#
# Supported Codecs:
@fians
fians / optimize.php
Created January 3, 2018 10:24
Optimize Image in PHP using Imagick according Google Pagespeed Recommendation
/**
* Optimize image image
*
* https://developers.google.com/speed/docs/insights/OptimizeImages
* -sampling-factor 4:2:0 -strip -quality 85 -interlace JPEG -colorspace sRGB
*
* @access public
* @param string $filePath Path of the file
* @return string Raw image result from the process
*/
@lukaspili
lukaspili / ScrollableViewController.swift
Last active March 17, 2023 12:35
Scroll view snap kit
import UIKit
import SnapKit
class ScrollableViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = UIColor.whiteColor()
let scrollView = UIScrollView()
@simenbrekken
simenbrekken / context.js
Created April 24, 2014 12:48
Manipulating React immutable stores with context
var Application = React.createClass({
childContextTypes: {
createProduct: React.PropTypes.func
},
getChildContext: function() {
return {
createProduct: this.createProduct
}
},