Skip to content

Instantly share code, notes, and snippets.

View swiftyfinch's full-sized avatar
🏖️
On vacation

Vyacheslav Khorkov swiftyfinch

🏖️
On vacation
View GitHub Profile
@dmytrogajewski
dmytrogajewski / gist:94876ee320e5fdd363479691485f32df
Created September 4, 2023 15:03
Pull stars from other user
package main
import (
"context"
"fmt"
"log"
"strings"
"github.com/google/go-github/v39/github"
"github.com/manifoldco/promptui"
@ryanlintott
ryanlintott / LayoutThatFits.swift
Last active December 8, 2023 15:14
An alternative to ViewThatFits. Updated version can be found here: https://github.com/ryanlintott/LayoutThatFits
//
// LayoutThatFits.swift
// WWDC22Experiments
//
// Created by Ryan Lintott on 2022-06-08.
//
import SwiftUI
struct LayoutThatFits: Layout {
🌞 Morning 65 commits ███▏░░░░░░░░░░░░░░░░░ 15.1%
🌆 Daytime 122 commits █████▉░░░░░░░░░░░░░░░ 28.3%
🌃 Evening 182 commits ████████▊░░░░░░░░░░░░ 42.2%
🌙 Night 62 commits ███░░░░░░░░░░░░░░░░░░ 14.4%

Enable indexing

  • defaults delete com.apple.dt.Xcode IDEIndexEnable
  • defaults write com.apple.dt.Xcode IDEIndexEnable -bool YES

Disable indexing

  • defaults delete com.apple.dt.Xcode IDEIndexDisable
  • defaults write com.apple.dt.Xcode IDEIndexDisable -bool YES

Show Indexing numeric progress

  • defaults write com.apple.dt.Xcode IDEIndexerActivityShowNumericProgress -bool YES
#-------------------------------------------------------------------------------
# CocoaPods
#-------------------------------------------------------------------------------
function pods_install() {
red="\001$(tput setaf 1)\002"
yellow="\001$(tput setaf 3)\002"
green="\001$(tput setaf 2)\002"
reset="\001$(tput sgr0)\002"
if [ "$1" = "-f" ] ; then
@nicklockwood
nicklockwood / Withable.swift
Created January 28, 2019 12:06
Withable.swift
/// Withable is a simple protocol to make constructing
/// and modifying objects with multiple properties
/// more pleasant (functional, chainable, point-free)
public protocol Withable {
init()
}
public extension Withable {
/// Construct a new instance, setting an arbitrary subset of properties
init(with config: (inout Self) -> Void) {
@Revolucent
Revolucent / UIView+Rx.swift
Created October 5, 2018 02:53
isFirstResponder observable with RxSwift
import RxCocoa
import RxSwift
import UIKit
extension Reactive where Base: UIView {
var isFirstResponder: Observable<Bool> {
return Observable
.merge(
methodInvoked(#selector(UIView.becomeFirstResponder)),
methodInvoked(#selector(UIView.resignFirstResponder))
@hjertnes
hjertnes / doom.txt
Created April 6, 2018 08:28
Doom Emacs Cheatsheet
SPC
SPC: find file
, switch buffer
. browse files
: MX
; EX
< switch buffer
` eval
u universal arg
x pop up scratch
@terabyte
terabyte / amazon.md
Created December 6, 2017 02:27
Amazon's Build System

Prologue

I wrote this answer on stackexchange, here: https://stackoverflow.com/posts/12597919/

It was wrongly deleted for containing "proprietary information" years later. I think that's bullshit so I am posting it here. Come at me.

The Question

Amazon is a SOA system with 100s of services (or so says Amazon Chief Technology Officer Werner Vogels). How do they handle build and release?

@sahara-ooga
sahara-ooga / HaveXcode9RenderMarkdown.md
Created November 26, 2017 09:18
Have Xcode 9 render markdown

Have Xcode 9 render markdown

To make Xcode 9 render markdown file eg. README.md, drop .xcodesamplecode.plist in your .xcodeproj/ folder. .xcodesamplecode.plist is like this:

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <array/> </plist>

For convenience, There is this tool, which is derived from a tutorial.