Skip to content

Instantly share code, notes, and snippets.

View kiliankoe's full-sized avatar
👩‍💻

Kilian Koeltzsch kiliankoe

👩‍💻
View GitHub Profile
@florianschmidt1994
florianschmidt1994 / custom_history.md
Last active July 23, 2019 17:24
Using custom fzf history with ctrl-r in zsh
function fh() {
   command=$(fc -ln 0|               # show history without line numbers
     tail -r         |               # reverse the order
     awk '!x[$0]++'  |               # drop duplicates (https://unix.stackexchange.com/a/193331)
     fzf -e +s \
         --color=light \
         --height=20 \
         --inline-info \
         --border \
func zalgo(_ string: String, intensity: Int = 5) -> String {
let combiningDiacriticMarks = 0x0300...0x036f
let latinAlphabetUppercase = 0x0041...0x005a
let latinAlphabetLowercase = 0x0061...0x007a
var output: [UnicodeScalar] = []
for scalar in string.unicodeScalars {
output.append(scalar)
guard (latinAlphabetUppercase).contains(numericCast(scalar.value)) ||
(latinAlphabetLowercase).contains(numericCast(scalar.value))
func g(_ x: inout Int) {
x = x * x
}
func f() {
var computed:Int {
get { return 5 }
set { print(newValue) }
}
g(&computed)
#!/bin/bash
# This script takes your chat and posts it to a webserver.
# Finally a chat protocol everyone can use!
if [[ -z $1 ]]; then
echo "First parameter must be the host!"
exit 1
fi
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@harlanhaskins
harlanhaskins / swift-format.swift
Created October 26, 2017 19:48
Simple Swift Formatter using SwiftSyntax
import Foundation
import SwiftSyntax
func main() throws {
guard CommandLine.arguments.count > 1 else {
print("usage: swift-format [file]")
exit(-1)
}
let url = URL(fileURLWithPath: CommandLine.arguments[1])
@jklmnn
jklmnn / preprocessor_fun.h
Created September 2, 2017 20:57 — forked from aras-p/preprocessor_fun.h
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
// Swift's untyped errors are a goddam PiTA. Here's the pattern I use to try to work around this.
// The goal is basically to try to guarantee that every throwing function in the app throws an
// ApplicationError instead of some unknown error type. We can't actually enforce this statically
// But by following this convention we can simplify error handling
enum ApplicationError: Error, CustomStringConvertible {
// These are application-specific errors that may need special treatment
case specificError1
case specificError2(SomeType)
@lattner
lattner / TaskConcurrencyManifesto.md
Last active April 29, 2025 02:59
Swift Concurrency Manifesto
@regexident
regexident / 0000-HashVisitable.md
Last active October 12, 2017 09:00
Swift Evolution Proposal Draft for replacing `Hashable` with `Hasher` and `HashVisitable`.

HashVisitable

During the review process, add the following fields as needed:

Introduction