Skip to content

Instantly share code, notes, and snippets.

@cenkbilgen
cenkbilgen / URLSessionDownloadPublisher.swift
Created February 26, 2020 20:52
An extension to URLSession to create a Combine Publisher for URLDownloadTask
import Foundation
import Combine
fileprivate class CancellableStore {
static let shared = CancellableStore()
var cancellables = Set<AnyCancellable>()
}
public enum DownloadOutput {
case complete(Data)
@henrik
henrik / images_helper.rb
Created February 11, 2015 07:57
Rails image_set_tag_3x helper for srcset.
module ImagesHelper
# Example usage:
#
# image_set_tag_3x "foo_1x.png", alt: "foo"
#
# Will assume there is a 2x and 3x version and provide those automagically.
#
# Based on https://gist.github.com/mrreynolds/4fc71c8d09646567111f
def image_set_tag_3x(source, options = {})
srcset = [ 2, 3 ].map { |num|
@jmsaavedra
jmsaavedra / ffmpeg_install.md
Last active February 29, 2024 09:36
Install FFmpeg on a Linux Box

Install FFmpeg via CLI on Linux box

These steps walk through installing a static binary of any ffmpeg version on to your linux machine. If you want to compile from source, there are several ways to do so. Here's the official guide. Tested and works on an AWS EC2 Ubuntu instance, but should work on any Linux machine.

  • SSH into your instance and become root