Skip to content

Instantly share code, notes, and snippets.

@LeonardoCardoso
LeonardoCardoso / update_version.sh
Created May 14, 2018 09:46
Update version on your project using a single command
function updateversion() {
OLD="$1"
NEW="$2"
grep -rl "$OLD" . --exclude-dir={"Build","libs","Pods",".git"} --exclude={"Podfile.lock","CHANGELOG.md","update-version.sh"} | xargs sed -i.bak "s/$OLD/$NEW/g";
find . -type f -name '*.bak' -delete
}
@LeonardoCardoso
LeonardoCardoso / andaction.sh
Last active October 30, 2018 09:56
AndAction - Script to Generate a Nice Folder Structure for Cinematography Projects
#!/bin/bash
### Functions
trim() {
local trimmed="$1"
# Strip leading space.
trimmed="${trimmed## }"
# Strip trailing space.
trimmed="${trimmed%% }"
@LeonardoCardoso
LeonardoCardoso / checkBitrate.sh
Last active October 30, 2018 09:56
Check Bitrate by afinfo
for i in **/*.mp3; do afinfo "$i" |grep "bit rate" ; done
@LeonardoCardoso
LeonardoCardoso / bitrateUp.sh
Last active October 30, 2018 09:56
Increate bitrate by ffmpeg
for f in *; do
if [[ -d $f ]]; then
cd $f
for i in **/*.mp3; do ffmpeg -i "$i" -codec:a libmp3lame -b:a 192k "0-$i" ; done
cd ../
else
for i in **/*.mp3; do ffmpeg -i "$i" -codec:a libmp3lame -b:a 192k "0-$i" ; done
fi
done
@krodak
krodak / Realm+CascadeDeleting.swift
Last active April 27, 2023 19:16
Cascade deletion for RealmSwift
import RealmSwift
import Realm
protocol CascadeDeleting: class {
func delete<Entity>(_ list: List<Entity>, cascading: Bool)
func delete<Entity>(_ results: Results<Entity>, cascading: Bool)
func delete<Entity: Object>(_ entity: Entity, cascading: Bool)
}
@LeonardoCardoso
LeonardoCardoso / README.md
Last active October 30, 2018 09:56
RXMVVM Shell function

Usage

$ rxmvvm "AddressList" "LightPass" "Leonardo Cardoso" "1aim.com" .

  • $1 = Name of File
  • $2 = Name of Project
  • $3 = Name of Author
  • $4 = Website
  • $5 = Path
@lattner
lattner / TaskConcurrencyManifesto.md
Last active May 23, 2024 03:59
Swift Concurrency Manifesto
@lattner
lattner / async_swift_proposal.md
Last active April 21, 2024 09:43 — forked from oleganza/async_swift_proposal.md
Concrete proposal for async semantics in Swift

Async/Await for Swift

Introduction

Modern Cocoa development involves a lot of asynchronous programming using closures and completion handlers, but these APIs are hard to use. This gets particularly problematic when many asynchronous operations are used, error handling is required, or control flow between asynchronous calls gets complicated. This proposal describes a language extension to make this a lot more natural and less error prone.

This paper introduces a first class Coroutine model to Swift. Functions can opt into to being async, allowing the programmer to compose complex logic involving asynchronous operations, leaving the compiler in charge of producing the necessary closures and state machines to implement that logic.

@LeonardoCardoso
LeonardoCardoso / GPG-Tower
Last active April 21, 2023 11:53
How to setup Tower to use the GPG Suite
# GPG on Tower
@LeonardoCardoso
LeonardoCardoso / GitHubDark.css
Created February 9, 2017 12:48
MacDown GitHubDark Theme
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote {
margin: 0;
padding: 0;