Skip to content

Instantly share code, notes, and snippets.

View dehlen's full-sized avatar

David v.Knobelsdorff dehlen

View GitHub Profile
@kylehughes
kylehughes / TornRectangle.swift
Last active May 7, 2024 07:17
A rectangle shape for SwiftUI that can render any edge like a torn piece of paper.
// Copyright 2021 Kyle Hughes
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
// documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
// Software.
//
@helje5
helje5 / SparkleCommands.swift
Last active January 11, 2023 00:37
How to hookup Sparkle in SwiftUI
//
// SparkleCommands.swift
// Past for iChat
//
// Created by Helge Heß on 08.04.21.
//
import SwiftUI
#if SPARKLE && canImport(Sparkle)
@sindresorhus
sindresorhus / ShowForAppRuns.swift
Created October 10, 2019 17:23
SwiftUI modifier to show a view only a given amount of app runs.
// Depends on https://github.com/sindresorhus/Defaults
@available(macOS 10.15, *)
private struct ShowForAppRuns: ViewModifier {
private static var runCounts = [String: Int]()
private let count: Int
private let startShowingFromAppRun: Int
private let runCount: Int
init(count: Int, id: String, startShowingFromAppRun: Int = 1) {
//
// Library.swift
// LabelLayout
//
// Created by Chris Eidhof on 09.09.18.
// Copyright © 2018 objc.io. All rights reserved.
//
import UIKit
@shaps80
shaps80 / 1. UserDefaults+Key.swift
Last active September 25, 2020 08:29
Adds a Swift extension to make UserDefaults more consistent to work with.
//
// UserDefaults.swift
//
// Created by Shaps Benkau on 24/05/2018.
// Copyright © 2018 152percent Ltd. All rights reserved.
//
import Foundation
#if os(iOS)
import UIKit
import Cartography // https://github.com/robb/Cartography
/**
This is an example of self sizing `UICollectionView` cells using AutoLayout,
where the width of cells is always the width of the parent, to mimic `UITableView`.
*/
fileprivate let items: [String] = (0..<100)
.map { _ in Lorem.sentences(Int.random(min: 1, max: 8)) } // Using https://github.com/lukaskubanek/LoremSwiftum/blob/master/Sources/LoremSwiftum.swift
@jorilallo
jorilallo / Flex.js
Created August 17, 2017 20:06
Flexbox component for React
// @flow
import React from 'react';
import styled from 'styled-components';
type GlobalCssValues = 'initial' | 'inherit' | 'unset';
type WrapValue = 'nowrap' | 'wrap' | 'wrap-reverse' | GlobalCssValues;
type JustifyValue =
| 'center'
@tmspzz
tmspzz / develop.rb
Last active January 18, 2022 09:37
An opinionated workflow for Carthage
#!/usr/bin/env ruby
# Copyright (c) 2016 Tommaso Piazza
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software
# and associated documentation files (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of
# the Software.
@rectifyer
rectifyer / tvdb.rb
Last active March 10, 2023 01:15
Get images from TVDB
require 'httparty'
# TVDB
TVDB_API_KEY = '[your api key]'
TVDB_USERNAME = '[your username]'
TVDB_USERKEY = '[your user key]'
image_prefix = 'http://thetvdb.com/banners/'
# get token
response = HTTParty.post('https://api.thetvdb.com/login', {
@idefux
idefux / jira.txt
Last active November 4, 2022 07:04
JIRA on a raspberry pi 2
JIRA on a raspberry pi 2
Since the raspberry pi 2 comes with 1 GB RAM and a 900 MHz quad-core I wanted to give it a try
if it is capable of running JIRA
Download free trial linux .tar.gz archive from https://www.atlassian.com/software/jira/download?b=j
Untar with tar -zxvf <archive>
Check java version and set JAVA_HOME
Make sure that you have a java version installed that is supported by JIRA