This file contains hidden or 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
| alias ql='qlmanage -p "$@" > /dev/null' |
This file contains hidden or 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
| - |
This file contains hidden or 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
| private func validatePassword() { | |
| self.passwordIsValid = false | |
| self.passwordIssue = nil | |
| guard let username = self.username, | |
| let email = self.email, | |
| let phoneNumber = self.phoneNumber, | |
| let password = self.password | |
| else { | |
| return |
This file contains hidden or 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
| func test_PasswordCanNotContainUsername() { | |
| let mockPasswordCollectorLauncher = MockPasswordCollectorLauncher() | |
| let mockListener = MockOnboardingManagerListener() | |
| let onboardingManager = BadOnboardingManager(passwordCollectorLauncher: mockPasswordCollectorLauncher) | |
| onboardingManager.listener = mockListener | |
| onboardingManager.start() | |
| // TODO: assert the username collector launches now. | |
| onboardingManager.usernameCollectorReturned(username: "ValidUsername") |
This file contains hidden or 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
| func testPasswordCanNotContainUsername() { | |
| let (didPass, issue) = OnboardingManager.validatePassword(password: "ValidUsername$123", | |
| username: "ValidUsername", | |
| email: "[email protected]", | |
| phoneNumber: "+11235554321") | |
| XCTAssertFalse(didPass) | |
| XCTAssertEqual(issue, PasswordIssue.containsUsername) | |
| } |
This file contains hidden or 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
| javascript: | |
| let tempInput = document.createElement("input"); | |
| tempInput.value = window.location.href + `#:~:text=${window.getSelection().toString()}`; | |
| document.body.appendChild(tempInput); | |
| tempInput.select(); | |
| document.execCommand("copy"); | |
| document.body.removeChild(tempInput); |
This file contains hidden or 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 { useState, useEffect, MutableRefObject } from 'react'; | |
| type Location = { x: number; y: number }; | |
| type Size = { width: number; height: number }; | |
| type Space = { location: Location; size: Size }; | |
| // The viewport information for the passed Div. | |
| const useViewportSpace = ( | |
| scrollArea: MutableRefObject<HTMLDivElement | undefined>, | |
| ): { content?: Space; viewport?: Space } => { |
This file contains hidden or 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/bash | |
| rootPlist=$(plutil -extract dnd_prefs xml1 -o - /Users/"$USER"/Library/Preferences/com.apple.ncprefs.plist) | |
| dataPlistB64=$(echo $rootPlist | xmllint --xpath "string(//data)" - ) | |
| dataPlist=$(echo $dataPlistB64 | base64 --decode | plutil -convert xml1 - -o -) | |
| scheduleDict=$(echo $dataPlist | xmllint --xpath "//dict/key[text()='scheduledTime']/following-sibling::*[1]" -) | |
| userPrefDict=$(echo $dataPlist | xmllint --xpath "//dict/key[text()='userPref']/following-sibling::*[1]" -) | |
| end=$(echo $scheduleDict | xmllint --xpath "number(//dict/key[text()='end']/following-sibling::*[1])" -) |
This file has been truncated, but you can view the full file.
This file contains hidden or 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
| { | |
| "c": "*", | |
| "e": [], | |
| "n": { | |
| "(": { | |
| "c": "(", | |
| "e": [], | |
| "n": { | |
| "b": { | |
| "c": "b", |
This file contains hidden or 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
| package main | |
| /* | |
| This program parses a DOT graph representing a chatbot's state machine. | |
| It supports single-select, multiple-select, message-sends, and hooks into programs. | |
| */ | |
| import ( | |
| "fmt" | |
| "gonum.org/v1/gonum/graph" |
OlderNewer