{{ message }}

Instantly share code, notes, and snippets.

💭
When in doubt, log it out

# Brian Flannery bflannery

💭
When in doubt, log it out
Created Apr 1, 2020
View keybase.md

### Keybase proof

I hereby claim:

• I am bflannery on github.
• I am bflanneryatx (https://keybase.io/bflanneryatx) on keybase.
• I have a public key ASCZM5oBZsOAVNP9U1OgIwdKOlCJ08g2peWYNeiuiw1ODwo

To claim this, I am signing this object:

Created Feb 3, 2019
Frequency Counter Challenge - sameFrequency
View sameFrequency.js
 // Frequency Counter - sameFrequency // Write a function called sameFrequency. Given two positive intergers, // find out if the two numbers have the same frequency of digits. // Solution Requirements // - Time Complexity: O(n) function sameFrequency(int1, int2) { const int1Arr = Array.from(int1.toString()).map(Number);
Created Jan 27, 2019
ES6 Hash Table
View es6_hash_table.js
 class HashTable { constructor(size) { this.buckets = Array(size); this.numBuckets = this.buckets.length; } hash() { var total = 0; for (var i = 0; i < key.length; i++) { total += key.charCodeAt(i);
Created Jan 26, 2019
ES6 Binary Search Tree
View binary_search_tree.js
 class BST { constructor(value) { this.value = value; this.left = null; this.right = null; } insert(value) { if (value <= this.value) { if (!this.left) this.left = new BST(value);
Last active Jan 24, 2019
Created Jan 23, 2019
JS Stack
View stack.js
 const _items = new WeakMap() class Stack { constructor(value) { _items.set(this, []); } push(value) { _items.get(this).push(value); }
Created Jan 18, 2019
Async Currency Converter
View async_currency_converter.js
 const getExchangeRate = async (from, to) => { try { const apiKey = '' // Add unique fixer.io apiKey const response = await axios.get(`http://data.fixer.io/api/latest?access_key=\${apiKey}&format=1`) const euro = 1 / response.data.rates[from]; const rate = euro * response.data.rates[to]; if (isNaN(rate)) { throw new Error() }
Created May 4, 2017
View input-example.component.ts
 @Component({ selector: 'friend-tour', template: `
• {{friends}}
Created Jan 20, 2017
return the sum of the two smallest positive integers
View sumTwoSmallestNumbers.js
 // return the sum of the two smallest positive integers function sumTwoSmallestNumbers(numbers) { let sorting = numbers.sort((a,b) => { if(a > b) { return a; } }); return sorting[0] + sorting[1];
Created Jan 20, 2017
Give 3 integers, will they make a triangle
View returnATriangle.js
 // Give 3 integers, will they make a triangle function isTriangle(a,b,c){ if(a+b > c && a+c > b && b+c > a) { return true; } else { return false; } }