This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Combine | |
public enum AnyError: Error { | |
case never(Never) | |
case failure(Error) | |
} | |
public enum AnyEvent { | |
case output(Any) | |
case completion(Subscribers.Completion<AnyError>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) 2019–20 Adam Sharp and thoughtbot, inc. | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: | |
// | |
// The above copyright notice and this permission notice shall be included in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) 2019–20 Adam Sharp and thoughtbot, inc. | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: | |
// | |
// The above copyright notice and this permission notice shall be included in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Darwin.C | |
import Dispatch | |
signal(SIGINT, SIG_IGN) | |
let source = DispatchSource.makeSignalSource(signal: SIGINT, queue: .main) | |
var count = 0 | |
source.setEventHandler { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Adam Sharp | |
# Aug 21, 2013 | |
# | |
# Usage: Add it to your PATH and `git remove-submodule path/to/submodule`. | |
# | |
# Does the inverse of `git submodule add`: | |
# 1) `deinit` the submodule | |
# 2) Remove the submodule from the index and working directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rspec/autorun" | |
class Enumerator::Lazy | |
def reduce(*) | |
Lazy.new([nil]) do |yielder, _| | |
yielder << super | |
end | |
end | |
def join(separator="") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Darwin | |
enum Signal: Int32 { | |
case HUP = 1 | |
case INT = 2 | |
case QUIT = 3 | |
case ABRT = 6 | |
case KILL = 9 | |
case ALRM = 14 | |
case TERM = 15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# View on GitHub: https://github.com/sharplet/Switch | |
# Try it yourself: git clone https://github.com/sharplet/Switch.git && cd Switch && rake | |
$ rake | |
mkdir -p Build | |
mkdir -p Build/Switch.framework | |
mkdir -p Build/Switch.framework/Versions/A/Modules/Switch.swiftmodule | |
ln -sf A Build/Switch.framework/Versions/Current | |
ln -sf Versions/Current/Modules Build/Switch.framework/Modules | |
ln -sf Versions/Current/Switch Build/Switch.framework/Switch | |
xcrun -sdk macosx swiftc -module-name Switch -emit-library -o Build/Switch.framework/Versions/Current/Switch -- Source/Array+Ext.swift Source/Option.swift Source/ParseResult.swift Source/Parser.swift Source/String+Ext.swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/Makefile.orig | |
+++ b/Makefile | |
@@ -533,7 +533,7 @@ | |
gitwebdir = $(sharedir)/gitweb | |
perllibdir = $(sharedir)/perl5 | |
localedir = $(sharedir)/locale | |
template_dir = share/git-core/templates | |
-htmldir = $(prefix)/share/doc/git-doc | |
+htmldir = $(prefix)/share/doc/git-core | |
ETC_GITCONFIG = $(sysconfdir)/gitconfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# bin/run: Run Swift commands in a project's bin/ directory. | |
# | |
# Drop-in replacement for `swift run`. | |
# Adds caching of built products based on source file contents. | |
# | |
# Usage: | |
# bin/run <command [options]> # Run named command defined in `bin/Package.swift` | |
# |
NewerOlder