Skip to content

Instantly share code, notes, and snippets.

View tylerarnold's full-sized avatar

Tyler tylerarnold

View GitHub Profile
@tylerarnold
tylerarnold / gist:27e9eac161432412038155b8d6a79ab4
Created November 15, 2023 16:21
x86 assembly of rust atomic implementation with acquire /release semantics
<core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::fold:
sub rsp, 56
mov rcx, rsi
mov rax, rdi
mov edi, dword ptr [rax + 8]
mov esi, dword ptr [rax + 12]
mov rax, qword ptr [rax]
mov rdx, qword ptr [rcx + 16]
mov qword ptr [rsp + 16], rdx
movups xmm0, xmmword ptr [rcx]
@tylerarnold
tylerarnold / NRFileManager.swift
Last active April 25, 2017 20:10
A method to calculate the accumulated size of a directory on the volume in bytes.
//
// Created by Nikolai Ruhe on 2016-02-10.
// Copyright (c) 2016 Nikolai Ruhe. All rights reserved.
// updated for Swift 3, Tyler Arnold 2017-04-25
//
import Foundation
extension FileManager {
func allocatedSizeOfDirectoryAtURL(directoryURL: URL) throws -> UInt64 {
@tylerarnold
tylerarnold / Contents.swift
Created March 2, 2017 04:11
swift 3.0 bug or deliberate behavior? At minimum a confusing error code.
//: Playground - noun: a place where people can play
import UIKit
var str = "Hello, playground"
protocol namer {
func name() -> String
}
@tylerarnold
tylerarnold / gist:9097440
Created February 19, 2014 17:50
successful build of coreutils (8.21 works, 8.22 does not)
git checkout ffe8fff Library/Formula/coreutils.rb
Loki:local tylerarnold$ brew install coreutils
==> Downloading http://ftpmirror.gnu.org/coreutils/coreutils-8.21.tar.xz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/coreutils/8.21 --program-prefix=g --without-gmp
==> make install
==> Caveats
All commands have been installed with the prefix 'g'.
If you really need to use these commands with their normal names, you
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* A GNU-like <stdio.h>.
Copyright (C) 2004, 2007-2013 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.