=IF(NOT(EQ({Source_Cell_ID},"")), CONCATENATE("[", TEXTJOIN(", ", true, ARRAYFORMULA(char(34)&TRIM(SPLIT({Source_Cell_ID},","))&char(34))), "]"), "")
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
LOGFILE="$HOME/Desktop/xcode-pre-action.txt" ; | |
print_pwd () { echo "pwd: $(pwd)" >> $LOGFILE ; } | |
bump_version () { agvtool bump ; } | |
echo "" > $LOGFILE ; | |
echo "Build Pre-Action" >> $LOGFILE | |
print_pwd ; | |
echo "PROJECT_DIR: $PROJECT_DIR" >> $LOGFILE ; | |
echo "cd into project directory" >> $LOGFILE ; |
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 updateOutline(isShowing: Bool, animated: Bool) { | |
let toColor: UIColor = isShowing ? .systemBlue : .clear | |
let toWidth: CGFloat = isShowing ? 2 : 0 | |
let animationDuration = 0.2 | |
if animated { | |
let borderColorAnimation: CABasicAnimation = CABasicAnimation(keyPath: "borderColor") | |
borderColorAnimation.fromValue = layer.borderColor | |
borderColorAnimation.toValue = toColor.cgColor | |
borderColorAnimation.duration = animationDuration |
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
function b( | |
a // placeholder | |
){ | |
return a // if the placeholder was passed, return | |
? ( // a random number from 0 to 15 | |
a ^ // unless b is 8, | |
Math.random() // in which case | |
* 16 // a random number from | |
>> a/4 // 8 to 11 | |
).toString(16) // in hexadecimal |
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
// Put this in a playground | |
import UIKit | |
import PlaygroundSupport | |
let wrapperView = UIView(frame: CGRect(x: 0, y: 0, width: 400, height: 160)) | |
wrapperView.backgroundColor = .lightGray | |
let roundedCornerView = UIView(frame: CGRect(x: 50, y: 50, width: 300, height: 60)) | |
roundedCornerView.backgroundColor = .white |
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
// Run in an Xcode Playground | |
let prices: [Double] = [6,0,-1,10] | |
let prices2: [Double] = [] | |
let prices3: [Double] = [1] | |
let prices4: [Double] = [6,0,-1,10,11,12,1,5,200,-2,200,32,-322,0,124,432,-1,-1000,1] | |
func solution(prices: [Double]) -> Double { | |
// the idea is to find the max between two key differences in the array: |
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
// Run in an Xcode Playground | |
let prices: [Double] = [6,0,-1,10,11,12,1,5,200,-2,200] | |
func solution(prices: [Double]) -> Double { | |
var possibleOutcomes: [Double] = [] | |
prices.enumerated().forEach { tuple in | |
let index = tuple.offset | |
let initialPrice = tuple.element | |
let pricesAfterInvestment = prices.suffix(from: index) |
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
// Run in an Xcode Playground | |
let input = ")(()(" | |
let input2 = "))()))(" | |
let input3 = "))))((((" | |
let input4 = ")))()(()()((" | |
let input5 = "(()())" | |
let input6 = "" | |
let input7 = "()" |
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
function createUUID(a){return a?(a^Math.random()*16>>a/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,createUUID)} |
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
var url = ''; | |
function callback() { | |
console.log(this.responseText); | |
} | |
var xhr = new XMLHttpRequest(); | |
xhr.addEventListener("load", callback); | |
xhr.open("GET", url); | |
xhr.send(); |
NewerOlder