Skip to content

Instantly share code, notes, and snippets.

View nysander's full-sized avatar
👨‍💻
Working at Tedee LLC

Paweł Madej nysander

👨‍💻
Working at Tedee LLC
View GitHub Profile
@ozgurshn
ozgurshn / SVGKFastImageViewSUI.swift
Created June 29, 2020 07:24
Using SVGKit in Swift UI
import SwiftUI
import SVGKit
struct SVGKFastImageViewSUI:UIViewRepresentable
{
@Binding var url:URL
@Binding var size:CGSize
func makeUIView(context: Context) -> SVGKFastImageView {
//
// BottomSheetView.swift
//
// Created by Majid Jabrayilov
// Copyright © 2019 Majid Jabrayilov. All rights reserved.
//
import SwiftUI
fileprivate enum Constants {
static let radius: CGFloat = 16
@AvdLee
AvdLee / FileManagerExtensions.swift
Last active November 19, 2023 23:23
Easily print out useful locations for usage during debugging on the Simulator.
extension FileManager {
/*
Prints out the locations of the simulator and the shared group folder.
This is useful for debugging file issues.
Example usage: FileManager.default.printFileLocations()
*/
func printFileLocations() {
let paths = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)
let simulatorFolder = paths.last!
@atomicbird
atomicbird / wwdc2019-online-sessions.md
Last active May 29, 2020 22:59
WWDC 2019 Online-only Sessions

At WWDC 2019 Apple released some videos directly online, with no corresponding live session. This is a list of those videos with links to the video pages.

Some sessions were presented during WWDC but then split into multiple videos when posted online. This list includes the online versions, since they don't appear in the WWDC schedule. For example WWDC included session 711, "Introducing Combine and Advances in Foundation". This was split into two online videos-- 722, "Introducing Combine", and 723, "Advances in Foundation". Both 722 and 723 are included here.

@jmn
jmn / config.yml
Last active May 27, 2023 04:20
CircleCI build and deploy via Rsync SSH in two steps
version: 2.1
executors:
my-executor:
docker:
- image: circleci/node:8
working_directory: /tmp
jobs:
build:
@joscdk
joscdk / env.md
Created December 5, 2018 14:45
Using .env files in Vapor 3

.env files can be an easy way to setup Environment variables locally. You can start using a .env files in Vapor 3 by following this small guide.

First setup the vapor-ext package in your Package.swift file:

.package(url: "https://github.com/vapor-community/vapor-ext.git", from: "0.1.0"),

Next create a .env file in the root of your project:

@geuis
geuis / gist:8b1b2ea57d7f9a9ae22f80d4fbf5b97f
Last active January 10, 2024 16:43
Get Youtube video urls
// Run from the dev tools console of any Youtube video
// Accurate as of July 2, 2020.
//
// Copy and paste this into the dev console in a browser with the desired video loaded.
//
// NOTE: Some Youtube videos do not directly expose the video url in the response.
// This script doesn't currently attempt to handle those. It will work for most other general video types though.
(async () => {
const html = await fetch(window.location.href).then((resp) => resp.text()).then((text) => text);
@snrbrnjna
snrbrnjna / .htaccess
Last active May 10, 2022 01:56
Jekyll Auth Plugin - to manage http basic auth for jekyll generated pages and directories
#### Jekyll Layout: /_layouts/.htaccess
# Apache Configuration File
{% if ((page.auth_dir.users != empty) or (page.auth_dir.groups != empty)) %}
AuthName "Privater Bereich"
AuthType Basic
# => mehrere Require Blocks werden geodert: http://d43.me/blog/1157
AuthzUserAuthoritative Off
AuthUserFile {{ page.auth_remote_user_file }}
@yokota-shinsuke
yokota-shinsuke / discover_s3
Created May 16, 2014 10:23
Monitor S3 with Zabbix
#!/usr/bin/ruby
require 'rubygems'
require 'aws-sdk'
require 'optparse'
require 'json'
discovery = {'data' => []}
s3 = AWS::S3.new
s3.buckets.each do |bucket|
@bobspryn
bobspryn / preferredFontDescriptorWithTextStyle sizes and styles
Created December 11, 2013 01:12
Apple iOS7 sizes and traits for all UIFontTextStyle's and UIContentSizeCategory's
UIContentSizeCategoryExtraSmall
FontStyle: UICTFontTextStyleBody
Point size 14.000000
Family Name .AppleSystemUIBody
FontStyle: UICTFontTextStyleHeadline
Point size 14.000000
Family Name .AppleSystemUIHeadline
Bold
FontStyle: UICTFontTextStyleSubhead
Point size 12.000000