Skip to content

Instantly share code, notes, and snippets.

View acecilia's full-sized avatar

Andrés Cecilia Luque acecilia

View GitHub Profile
@asalom
asalom / tools.md
Last active April 22, 2020 14:42
Alex Salom's tools & more
  1. iTerm 2
  2. Oh My Zsh
  3. Powerline shell: path bars, edit config and remove username and hostname
  4. Meslo Powerline Font as you need a font that supports the directory characters for powerline
  5. Homebrew
  6. RVM
  7. Bundler
  8. direnv: Unclutter your .profile
  9. z: quickly jump between projects. Like Alfred but for your Terminal reduced to folder search only
  10. echo "gem: --no-document" >> ~/.gemrc to stop installing docs every time you install a gem
@pepasflo
pepasflo / .gitignore
Last active October 22, 2023 12:06
Scripts for encrypting / decrypting secrets (to prevent them from being accidentally checked into git)
secrets/
@tclementdev
tclementdev / libdispatch-efficiency-tips.md
Last active April 26, 2024 10:15
Making efficient use of the libdispatch (GCD)

libdispatch efficiency tips

The libdispatch is one of the most misused API due to the way it was presented to us when it was introduced and for many years after that, and due to the confusing documentation and API. This page is a compilation of important things to know if you're going to use this library. Many references are available at the end of this document pointing to comments from Apple's very own libdispatch maintainer (Pierre Habouzit).

My take-aways are:

  • You should create very few, long-lived, well-defined queues. These queues should be seen as execution contexts in your program (gui, background work, ...) that benefit from executing in parallel. An important thing to note is that if these queues are all active at once, you will get as many threads running. In most apps, you probably do not need to create more than 3 or 4 queues.

  • Go serial first, and as you find performance bottle necks, measure why, and if concurrency helps, apply with care, always validating under system pressure. Reuse

@htinlinn
htinlinn / DecodableRoot.swift
Last active June 3, 2023 21:10
Decode JSON at root level based on a key
extension JSONDecoder {
func decode<T: Decodable>(_ type: T.Type, from data: Data, keyedBy key: String?) throws -> T {
if let key = key {
// Pass the top level key to the decoder.
userInfo[.jsonDecoderRootKeyName] = key
let root = try decode(DecodableRoot<T>.self, from: data)
return root.value
} else {
@emaloney
emaloney / guard-closure.md
Last active August 1, 2023 00:24
A simplified notation for avoiding the weak/strong dance with closure capture lists

Simplified notation for avoiding the [weak self]/strongSelf dance with closures

  • Proposal: TBD
  • Author: Evan Maloney
  • Status: Draft
  • Review manager: TBD

Introduction

Frequently, closures are used as completion callbacks for asynchronous operations, such as when dealing with network requests. It is quite common to model these sorts of operations in such a way that an object instance represents a request/response transaction, for example:

@eyecatchup
eyecatchup / git-commit-log-stats.md
Last active April 25, 2024 13:54
Some commands to get git commit log statistics for a repository on the command line.

git commit stats

Commands to get commit statistics for a Git repository from the command line -
using git log, git shortlog and friends.




@denvazh
denvazh / INSTALL.md
Created November 24, 2015 07:14
Ruby development environment with rbenv and bundler

Ruby

Rbenv

Used to manage ruby environment, since it is more beneficial and clean to use non-system one.

Install rbenv and ruby-build

@CodaFi
CodaFi / alltheflags.md
Last active October 26, 2022 20:09
Every Option and Flag /swift (1.2) Accepts Ever

#Every Single Option Under The Sun

  • optimization level options
  • automatic crashing options
  • debug info options
  • swift internal options
  • swift debug/development internal options
  • linker-specific options
  • mode options
@hieblmedia
hieblmedia / .gitignore
Last active March 20, 2024 01:22
Gitignore - Exclude all except specific subdirectory
#
# If all files excluded and you will include only specific sub-directories
# the parent path must matched before.
#
/**
!/.gitignore
###############################
# Un-ignore the affected subdirectory