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
# npm using https for git | |
git config --global url."https://github.com/".insteadOf [email protected]: | |
git config --global url."https://".insteadOf git:// | |
# npm using git for https | |
git config --global url."[email protected]:".insteadOf https://github.com/ | |
git config --global url."git://".insteadOf https:// |
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
// Reusing the idea in https://gist.github.com/akosma/07249e6718ace1ba6066 | |
precedencegroup ElementOfPrecedence { | |
associativity: left | |
higherThan: BitwiseShiftPrecedence | |
} | |
infix operator ∈ : ElementOfPrecedence | |
func ∈<T> (x: T, array: [T]) -> Bool where T: Equatable { | |
array.contains(x) |
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
1. Install the extension | |
2. Login into pro account | |
3. Open chrome://extensions | |
4. Enable Developer mode | |
5. Open Vivaldi > Inpect views > background page and execute the following: | |
> chrome.permissions.request({permissions: ["webNavigation", "tabs", "contextMenus", "activeTab"], origins: ["https://your.github.enterprise.com/*"]}) | |
# Then *login* into pro account |
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 | |
set -euo pipefail | |
tmpdir=$(mktemp -d "/tmp/$(basename "$0").XXXXX") | |
bn1=$(basename "$1") | |
bn2=$(basename "$2") | |
diff="$tmpdir/diff-$bn1-$bn2.png" |
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
#! /usr/bin/ruby | |
require 'xcodeproj' | |
xcscheme, * = ARGV | |
scheme = Xcodeproj::XCScheme.new File.join(xcscheme) | |
test_action = scheme.test_action | |
test_action.code_coverage_enabled = true | |
scheme.test_action = test_action |
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
class RunLoopPerformVsDispatchQueueAsyncTests: XCTestCase { | |
func testRunLoopPerformTakesPriorityOverDispatchAsync() { | |
enum Event { | |
case dispatchQueueAsync | |
case runLoopPerform | |
} | |
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
protocol MyProtocol { | |
func methodA() | |
func methodB() | |
} | |
class MyProtocolDefaults { | |
func methodA() { | |
print("Default methodA") | |
} | |
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
protocol MyProtocol { | |
func methodA() | |
func methodB() | |
} | |
extension MyProtocol { | |
func methodA() { | |
print("Default methodA") | |
} | |
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
protocol P { | |
func foo() | |
} | |
extension P { | |
func foo() { print("P") } | |
} | |
class A: P {} | |
class B: A { |
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
# Append the block below to your Podfile | |
post_install do |installer| | |
installer.pods_project.targets.each do |target| | |
target.build_configurations.each do |configuration| | |
configuration.build_settings['CLANG_ENABLE_CODE_COVERAGE'] = 'NO' | |
configuration.build_settings['SWIFT_EXEC'] = '$(SRCROOT)/SWIFT_EXEC-no-coverage' | |
end | |
end | |
end |
NewerOlder