We've learned that each device connected to a network is assigned an IP address. This includes your mobile phones and computers, and if you have a toaster that's hooked up to the Internet then your toaster, too.
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
/* | |
time: O(log n) | |
space: O(1) | |
*/ | |
function binarySearch(value, array) { | |
let start = 0 | |
let end = array.length |
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
/* | |
time: O(m + n) | |
space: O(n) // whichever is smaller | |
arr1 = [ 1, 2, 3, 5, 6, 7 ] | |
^ | |
arr2 = [ 3, 6, 7, 8, 20 ] | |
^ | |
arr3 = [ 3, 6, 7 ] |
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 hasDuplicateValue(array) { | |
let counter = 0 | |
for (let i = 0; i < array.length; i++) { | |
for (let j = 0; j < array.length; j++) { | |
counter++ | |
if (i !== j && array[i] === array[j]) { | |
return true | |
} | |
} | |
} |
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
class Payment { | |
constructor() { | |
this.paymentMethod = '' | |
} | |
setPaymentMethod(paymentMethod) { | |
this.paymentMethod = paymentMethod | |
} | |
pay(amount) { |
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
{ | |
"11111" : "a", | |
"11112" : "a&p", | |
"11113" : "a's", | |
"11114" : "aa", | |
"11115" : "aaa", | |
"11116" : "aaaa", | |
"11121" : "aaron", | |
"11122" : "ab", | |
"11123" : "aba", |
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
open -a safari https://youtu.be/X2W3aG8uizA | |
osascript -e 'set volume output volume 100' |
9 steps to better software design today, by Jeff Bay
- http://www.xpteam.com/jeff/writings/objectcalisthenics.rtf
- http://www.pragprog.com/titles/twa/thoughtworks-anthology
We’ve all seen poorly written code that’s hard to understand, test, and maintain. Object-oriented programming promised to save us from our old procedural code, allowing us to write software incrementally, reusing as we go along. But sometimes it seems like we’re just chasing down the
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
### Keybase proof | |
I hereby claim: | |
* I am jsstrn on github. | |
* I am jsstrn (https://keybase.io/jsstrn) on keybase. | |
* I have a public key ASCG6WnBjTnsIlYCuk0PoUmbXEOhnBREUXI5DBNYj1pdKwo | |
To claim this, I am signing this object: |
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
export const Square = () => { | |
const createLength = (length) => { | |
return 'x'.repeat(length) | |
} | |
const createHeight = (length) => { | |
return 'x' + ' '.repeat(length - 2) + 'x' | |
} | |
const createArray = (length) => { |
NewerOlder