Skip to content

Instantly share code, notes, and snippets.

View regex.swift
import Foundation
/// Provides NSRegularExpression pattern matching
/// against strings in `switch` and `~=` statements
public struct Regex {
public let regexPattern: String
public let options: NSRegularExpression.Options
/// Initialize a `Regex` instance that
/// defaults to no options. Update as needed for
fmedery /
Created Sep 11, 2017 — forked from royling/
tmux in iTerm2 cheatsheet

Commit Message Guidelines

Short (72 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
monkut / Ubuntu1604py36Dockerfile
Last active Mar 19, 2021
Base Docker image for ubuntu-16.04 & Python3.6
View Ubuntu1604py36Dockerfile
# docker build -t ubuntu1604py36
FROM ubuntu:16.04
RUN apt-get update && \
apt-get install -y software-properties-common && \
add-apt-repository ppa:jonathonf/python-3.6
RUN apt-get update
RUN apt-get install -y build-essential python3.6 python3.6-dev python3-pip python3.6-venv
RUN apt-get install -y git
chretm / gist:fdcefce520ddfa1b66af3c730d4928c0
Created Apr 13, 2017
View gist:fdcefce520ddfa1b66af3c730d4928c0
#author : Sujit Pal
#Note: this is a python3 updated version of
# by mathieu Chrétien (
#contributor : Mathieu Chrétien
from __future__ import division
import nltk
from nltk.corpus import wordnet as wn
tayvano / gist:6e2d456a9897f55025e25035478a3a50
Created Feb 19, 2017
complete list of ffmpeg flags / commands
View gist:6e2d456a9897f55025e25035478a3a50
Originall From: Posted 2015-05-29
This is the complete list that’s outputted by ffmpeg when running ffmpeg -h full.
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}…
Getting help:
-h — print basic options
-h long — print more options
-h full — print all options (including all format and codec specific options, very long)
Brainiarc7 /
Last active Jun 23, 2021
Guide: How to build gstreamer from source on Ubuntu 16.04 for loading via the modules system

Build gstreamer from source (git checkouts):

Install build dependencies:

sudo apt-get install gtk-doc-tools liborc-0.4-0 liborc-0.4-dev libvorbis-dev libcdparanoia-dev libcdparanoia0 cdparanoia libvisual-0.4-0 libvisual-0.4-dev libvisual-0.4-plugins libvisual-projectm vorbis-tools vorbisgain libopus-dev libopus-doc libopus0 libopusfile-dev libopusfile0 libtheora-bin libtheora-dev libtheora-doc libvpx-dev libvpx-doc libvpx3 libqt5gstreamer-1.0-0 libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libflac++-dev libavc1394-dev libraw1394-dev libraw1394-tools libraw1394-doc libraw1394-tools libtag1-dev libtagc0-dev libwavpack-dev wavpack


hervenicol / run.tpl
Last active Sep 23, 2019 — forked from efrecon/run.tpl
`docker inspect` template to regenerate the `docker run` command that created a container
View run.tpl
docker run \
--name={{.Name}} \
{{range $e := .Config.Env}}--env={{printf "%q" $e}} \
{{end}}{{range $p, $conf := .NetworkSettings.Ports}}{{with $conf}}-p {{(index $conf 0).HostIp}}:{{(index $conf 0).HostPort}}:{{$p}} \
{{end}}{{end}}{{range $n, $conf := .NetworkSettings.Networks}}{{with $conf}}--network {{printf "%q" $n}} \
{{range $conf.Aliases}}--network-alias {{printf "%q" .}} {{end}} \
{{end}}{{end}}{{range $v := .HostConfig.VolumesFrom}}--volumes-from={{printf "%q" .}} \
{{end}}{{range $v := .HostConfig.Binds}}--volume={{printf "%q" .}} \
{{end}}{{range $l, $v := .Config.Labels}}--label {{printf "%q" $l}}={{printf "%q" $v}} \
{{end}}{{range $v := .HostConfig.CapAdd}}--cap-add {{printf "%q" .}} \
Gurdeep0602 / AppStoryboard.swift
Last active Feb 26, 2021
AppStoryboard enumeration
View AppStoryboard.swift
// AppStoryboards.swift
// AppStoryboards
// Created by Gurdeep on 15/12/16.
// Copyright © 2016 Gurdeep. All rights reserved.
import Foundation
import UIKit
View Using Swift Package Manager with

Using Swift Package Manager with iOS

Step 1:

File > New > Project...

Step 2:

Create a Package.swift file in your root project directory, add dependencies, then run swift package fetch on the command line in the same directory. We’re not going to run swift build because it will just complain.