Skip to content

Instantly share code, notes, and snippets.

Lukas Stabe ahti

Block or report user

Report or block ahti

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View sliding_window.swift
struct SlidingWindowView<C: RandomAccessCollection>: RandomAccessCollection {
enum EndBehavior {
case stop
case truncate
let base: C
let windowSize: Int
let stepSize: Int
let endBehavior: EndBehavior
ahti / mp3.tcl
Last active Aug 9, 2018
Hex Fiend binary template to read mp3 frames, very rough and needs hexf>=2.10
View mp3.tcl
# This is a binary template for inspecting mp3 files in HexFiend
set count 0
proc : {args} {lindex $args 0}
p=$(cd ../swift; pwd)
pkgver=$(cd $p/swift; git describe | tr - _)
pkgdesc="Swift git builds."
depends=('python2' 'python2-six' 'libutil-linux' 'icu' 'libbsd' 'libedit' 'libxml2' 'sqlite' 'ncurses' 'libblocksruntime')
View err-336230bea9ed7052d3bc75715bc4d627.demangled
#0 PrintStackTraceSignalHandler(void*) (/usr/bin/swift+0x3f778d4)
#1 llvm::sys::RunSignalHandlers() (/usr/bin/swift+0x3f756ec)
#2 $SignalHandler(int) (/usr/bin/swift+0x3f77a92)
#3 _restore_rt (/usr/lib/
#4 generic specialization <Swift.Int, Foundation.URLSessionTask> of Swift._VariantDictionaryBuffer.ensureUniqueNativeBuffer(withBucketCount: Swift.Int) -> (reallocated: Swift.Bool, capacityChanged: Swift.Bool) (/usr/lib/swift/linux/
#5 generic specialization <Swift.Int, Foundation.URLSessionTask> of Swift._VariantDictionaryBuffer.nativeRemove(at: Swift._NativeDictionaryIndex<A, B>) -> (key: A, value: B) (/usr/lib/swift/linux/
#6 Foundation.URLSession._TaskRegistry.remove(Foundation.URLSessionTask) -> () (/usr/lib/swift/linux/
#7 partial apply forwarder for closure #3 () -> () in Foundation._ProtocolClient.urlProtocolDidFinishLoading(Foundation.URLProtocol) -> () (/usr/lib/swift/linux/
ahti / qalc.swift
Last active May 16, 2018
A script for an Alfred qalc workflow
View qalc.swift
#!/usr/bin/env bash
if [[ "$source" -nt "$compiled" ]]; then
swiftc "$source" -o "$compiled" || exit
"$compiled" "$@"
View simd.swift
// this needs to run with the `-parse-stdlib` command line option passed to swift:
// swift -parse-stdlib simd.swift
import Swift //Import swift stdlib
struct DoubleX4 {
var _v: Builtin.Vec4xFPIEEE64
subscript(_ idx: Int32) -> Double {
get {
View generic_property.swift
struct Property<T> {
let name: String
extension Property {
static var someBool: Property<Bool> { return Property<Bool>(name: "bool") }
static var someString: Property<String> { return Property<String>(name: "lol") }
struct Foo {
View bind.patch
diff --git a/include/lldb/Utility/TaskPool.h b/include/lldb/Utility/TaskPool.h
index db15b2081..3e6d5df8f 100644
--- a/include/lldb/Utility/TaskPool.h
+++ b/include/lldb/Utility/TaskPool.h
@@ -33,6 +33,7 @@
#include <queue>
#include <thread>
#include <vector>
+#include <functional>
View gist:e1d7538cb1e0a8359d724f69dfa5fb59
> choco install -debug -verbose -y mpv.portable
Chocolatey is running on Windows v 6.3.9600.0
Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".
Attempting to delete file "C:\ProgramData\chocolatey\choco.exe.old".
Command line: "C:\ProgramData\chocolatey\choco.exe" install -debug -verbose -y mpv.portable
Received arguments: install -debug -verbose -y mpv.portable
NOTE: Hiding sensitive configuration data! Please double and triple
check to be sure no sensitive data is shown, especially if copying
You can’t perform that action at this time.