Skip to content

Instantly share code, notes, and snippets.

View Kirow's full-sized avatar

Kirill Serebriakov Kirow

View GitHub Profile
@sorny
sorny / x11_forwarding_macos_docker.md
Last active April 30, 2024 02:00
X11 forwarding with macOS and Docker

X11 forwarding on macOS and docker

A quick guide on how to setup X11 forwarding on macOS when using docker containers requiring a DISPLAY. Works on both Intel and M1 macs!

This guide was tested on:

  • macOS Catalina 10.15.4
  • docker desktop 2.2.0.5 (43884) - stable release
  • XQuartz 2.7.11 (xorg-server 1.18.4)
  • Macbook Pro (Intel)
@levitatingpineapple
levitatingpineapple / UIFont.Features.swift
Last active March 27, 2024 18:30
SFPro Font Features
import UIKit
extension UIFont {
/// Watch [WWDC Session](https://developer.apple.com/videos/play/wwdc2015/804/).
/// [Font Feature Registry](https://developer.apple.com/fonts/TrueType-Reference-Manual/RM09/AppendixF.html)
/// - Parameters:
/// - size: The size (in points) to which the font is scaled. This value must be greater than 0.0.
/// - weight: The weight of the font, specified as a font weight constant.
/// - features: Font features supported by SFPro
@timothycosta
timothycosta / SwiftUIKeyboardAnimation.swift
Last active March 12, 2024 21:10
Create a SwiftUI Animation with the correct curve and duration from UIKit keyboard notifications
func animation(from notification: Notification) -> Animation? {
guard
let info = notification.userInfo,
let duration = info[UIResponder.keyboardAnimationDurationUserInfoKey] as? Double,
let curveValue = info[UIResponder.keyboardAnimationCurveUserInfoKey] as? Int,
let uiKitCurve = UIView.AnimationCurve(rawValue: curveValue)
else {
return nil
}
@zrxq
zrxq / .lldbinit
Last active February 7, 2024 11:21
Execute lldb command and open its output in Sublime Text
comma script import ~/lldb/subl.py
comma script add -f subl.subl subl
@jasorod
jasorod / SVGPath.swift
Last active January 31, 2024 19:13 — forked from dotcypress/SVGPath.swift
SVG path to CGPath converter
//
// SVGPath.swift
// SVGPath
//
// Created by Tim Wood on 1/21/15.
// Updated by Vitaly Domnikov 10/6/2015
// Updated by Jason Rodriguez 08/29/2017
// Copyright (c) 2015 Tim Wood, Vitaly Domnikov, Jason Rodriguez. All rights reserved.
import Foundation
@jasonrudolph
jasonrudolph / about.md
Last active January 6, 2024 07:40
Programming Achievements: How to Level Up as a Developer
@akhilcb
akhilcb / CGPoint+Extension.swift
Created May 7, 2017 23:22
CGPoint extension with some useful functions for angle and point calculation on arc and circles
// Taken from ACBRadialMenuView Project
// BSD 3-Clause License
// Copyright (c) 2017, akhilcb (https://github.com/akhilcb)
extension CGPoint {
static func pointOnCircle(center: CGPoint, radius: CGFloat, angle: CGFloat) -> CGPoint {
let x = center.x + radius * cos(angle)
let y = center.y + radius * sin(angle)
@derEremit
derEremit / gource-multiple-repositories.sh
Created November 8, 2011 14:58 — forked from anonymous/gource-multiple-repositories.sh
Generates gource video out of multiple repositories.
#!/usr/bin/env bash
# Generates gource video (h.264) out of multiple repositories.
# Pass the repositories in command line arguments.
# Example:
# <this.sh> /path/to/repo1 /path/to/repo2
RESOLUTION="1600x1080"
outfile="gource.mp4"
i=0
@nazywamsiepawel
nazywamsiepawel / UINavigationBarWithSubtitle.swift
Last active July 20, 2023 11:58
UINavigationBar with subtitle / swift
func setTitle(title:String, subtitle:String) -> UIView {
let titleLabel = UILabel(frame: CGRect(x:0, y:-5, width:0, height:0))
titleLabel.backgroundColor = UIColor.clear
titleLabel.textColor = UIColor.gray
titleLabel.font = UIFont.boldSystemFont(ofSize: 17)
titleLabel.text = title
titleLabel.sizeToFit()