Skip to content

Instantly share code, notes, and snippets.

View andreytorlopovold's full-sized avatar
😃
Smile, it annoys everyone!

Andrey Torlopov andreytorlopovold

😃
Smile, it annoys everyone!
View GitHub Profile
@emotality
emotality / duplicate_line_xcode.md
Last active April 6, 2024 04:23
Xcode - Duplicate Line key binding

NOTE (2022-07-09): Xcode finally added this functionality in Xcode 14, please see release notes here:

New Features in Xcode 14 Beta 3
When editing code, the Edit > Duplicate menu item and its corresponding keyboard shortcut now duplicate the selected text — or the line that currently contains the insertion point, if no text is selected. (8614499) (FB5618491)


Xcode line duplicate

Bind keys to duplicate lines in Xcode

@jpillora
jpillora / install-micro.sh
Last active September 15, 2018 15:39
install micro text editor from https://github.com/zyedidia/micro/releases
#!/bin/bash
#os check
case `uname -s` in
Darwin) OS="osx";;
Linux) OS="linux64";;
*) echo "unknown os: $(uname -s)" && exit 1;;
esac
#version check
echo -n "checking latest version... "
VER=`curl -sI https://github.com/zyedidia/micro/releases/latest | grep Location | sed "s~^.*tag\/v~~" | tr -d '\n' | tr -d '\r'`
@jordanekay
jordanekay / Dictionary.swift
Last active February 11, 2021 16:01
Mapping dictionaries in Swift
extension Dictionary {
public func map<T: Hashable, U>(@noescape transform: (Key, Value) -> (T, U)) -> [T: U] {
var result: [T: U] = [:]
for (key, value) in self {
let (transformedKey, transformedValue) = transform(key, value)
result[transformedKey] = transformedValue
}
return result
}
@JaviLorbada
JaviLorbada / FRP iOS Learning resources.md
Last active June 17, 2024 06:08
The best FRP iOS resources.

Videos

@pravj
pravj / treegen.sh
Last active September 8, 2021 09:43
bash script to generate tree structure of a directory
#!/usr/bin/env bash
# bash script to generate tree structure of a directory
# Pravendra Singh (@hackpravj)
pwd=$(pwd)
find $pwd -print | sed -e "s;$pwd;\.;g;s;[^/]*\/;|__;g;s;__|; |;g"
@ttscoff
ttscoff / matrixish.sh
Created September 15, 2012 18:23
A Matrix-ish display for Bash terminal
#!/bin/bash
#
# matrix: matrix-ish display for Bash terminal
# Author: Brett Terpstra 2012 <http://brettterpstra.com>
# Contributors: Lauri Ranta and Carl <http://blog.carlsensei.com/>
#
# A morning project. Could have been better, but I'm learning when to stop.
### Customization:
blue="\033[0;34m"