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) {
@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.

@wojteklu
wojteklu / clean_code.md
Last active July 23, 2024 07:47
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@a13xb
a13xb / Podfile
Created January 11, 2016 12:21
Quick workaround for per-target asset catalog compilation using a Podfile post_install hook
# ...
# Workaround for https://github.com/CocoaPods/CocoaPods/issues/1546
post_install do |installer|
installer.aggregate_targets.each do |at|
files = at.user_targets.map{|t|
t.resources_build_phase.files_references.select{|f|
f.last_known_file_type == 'folder.assetcatalog'
}.map{|f|
Pathname.new(f.real_path).relative_path_from(f.project.path.dirname)