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. What's the difference between a cookie and a session? | |
A cookie is a string of data that is set on response to be stored on client. It works as an encrypted data package used for managing communication. | |
A session is more like an object that exists on the request | |
2. What's serialization and how does it come into play with cookies? | |
Object --> string (Cookies serialize data) | |
3. Can a cookie be shared by more than one user? How/why? | |
Yes, if both users are on the same client. (But really shouldn't be) |
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. What does it mean for an application to be multi-tenant? | |
2. What would you want to build an application to be multi-tenant? | |
3. How do you implement multi-tenancy at the data / database level? | |
4. How do Active Record scopes help keep tenant data segregated? | |
5. Why is multi-tenancy dangerous from a security/privacy perspective? |
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
The idea of genius is often based on some unnatural skill or knowledge. But new science on the idea of mylination and deep practice pushes us to rethink this. I will be discussing this idea, and the application of it to programming as associated skills. Looking at specifically code kata, touch typing, and logical thinking. I don't know what else you want in a gist so...thats it. |
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
//Access to the new NSLinguisticTagger APIs are provided as a public enum as: | |
public enum NSLinguisticTagger: Int { | |
case word | |
case sentence | |
case paragraph | |
case document | |
} | |
//To see what units and schemes are available use a class level function: |
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 UIKit | |
// Merge sort in Swift | |
// Split arrays | |
func mergeSort(array: [Int]) -> [Int] { | |
guard array.count > 1 else { | |
return array |
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
func bubbleSort(array: [Int]) -> [Int] { | |
var array = array | |
for i in 0..<array.count { | |
for j in 1..<array.count - i { | |
if array[j] < array[j - 1] { | |
array.swapAt(j, j - 1) | |
} | |
} | |
} |
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
struct Nucleotide { | |
private let validNucleotides = "ATCG" | |
private var errorMessage: ((Character) -> (String)) = { n in | |
return "\(n) is not a valid Nucleotide" | |
} | |
let dna: String | |
init(_ dna: String) { |
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 Foundation | |
func quickSort(array: inout [Int], low: Int, high: Int) { | |
// if the high index value is greater than the low index value we need to partition and sort | |
if high > low { | |
// determine our pivot index by generating partitions | |
let pi = partition(array: &array, low: low, high: high) | |
// recursively pass our upper and lower partitions back into quickSort using the new pivot index | |
quickSort(array: &array, low: low, high: pi - 1) |
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
struct Car { | |
let make: String | |
let model: String | |
var color: String | |
private(set) var mileage: Int? = 0 | |
mutating func update(mileage: Int) { | |
self.mileage = mileage | |
} |
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
panic(cpu 0 caller 0xffffff7f8b212498): "Graphics firmware encountered an exception (eip: 0xbd82, fault #: 0xd)\n"@skl/sched3/IGGuC.cpp:889Backtrace (CPU 0), Frame : Return Address0xffffff83c5b03b70 : 0xffffff800691963d 0xffffff83c5b03bc0 : 0xffffff8006a53ae5 0xffffff83c5b03c00 : 0xffffff8006a4566e 0xffffff83c5b03c50 : 0xffffff80068bfa40 0xffffff83c5b03c70 : 0xffffff8006918d07 0xffffff83c5b03d70 : 0xffffff80069190f7 0xffffff83c5b03dc0 : 0xffffff80070c01cc 0xffffff83c5b03e30 : 0xffffff7f8b212498 0xffffff83c5b03e80 : 0xffffff7f8b187ef6 0xffffff83c5b03ee0 : 0xffffff800702bc5d 0xffffff83c5b03f30 : 0xffffff800702a52e 0xffffff83c5b03f70 : 0xffffff8007029b26 0xffffff83c5b03fa0 : 0xffffff80068bf13e Kernel Extensions in backtrace: com.apple.driver.AppleIntelKBLGraphics(14.0.7)[D944342F-11C2-38F7-A113-412261DE3D36]@0xffffff7f8b186000->0xffffff7f8b27cfff dependency: com.apple.iokit.IOPCIFamily(2.9)[017B6656-0279-38F7-917D-97CB6A21AC33]@0xffffff7f87312000 dependency: com.apple.iokit.IO |
OlderNewer