An evolving set of best practices for writing maintainable Javascript and CSS
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
it('can generate a viewing key for a given confidential address', async () => { | |
const VIEWING_KEY = | |
'm-test-shl-ad14aac56vn5uqh6d27grl778ne8euvgra3jat9tkyhrxnxx3hwtphup4hlwpd02dkut27ygpcaq53' | |
const mockImplementation = (address: string): Promise<string> => { | |
if (address) { | |
return Promise.resolve(VIEWING_KEY) | |
} | |
return Promise.reject(VIEWING_KEY) | |
} |
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
query ProjectOwner($login: String!) { | |
projectOwner(login: $login) { | |
websiteUrl | |
} | |
} | |
"vs" | |
query projectOwner(login: String!) { | |
websiteUrl |
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
div { | |
position: relative; | |
overflow: hidden; | |
padding-top: 56.25%; | |
} | |
iframe { | |
position: absolute; | |
top: 0; | |
left: 0; |
I hereby claim:
- I am marcushurney on github.
- I am marcushurney (https://keybase.io/marcushurney) on keybase.
- I have a public key ASBzRciT9lPWMPbRU4mRrvOYeTgekUrKrP4Qj7XSUSQcUwo
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
// inside button click handler | |
saveNotes(removeNote(id)) |
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
const removeNote = id => notes.filter(note => note.id !== id); |
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
// @flow | |
import React from 'react'; | |
import type { Ref } from 'react'; | |
// external libraries | |
import SVGInline from 'react-svg-inline'; | |
import classnames from 'classnames'; | |
// internal assets | |
import spinnerIconBig from '../../themes/simple/assets/spinner-big.inline.svg'; |
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
Array.prototype.createMap = Array.prototype.createMap || function(callback) { | |
var newArray = []; | |
for (var i = 0; i < this.length; i++) { | |
var result = callback(this[i], i); | |
newArray.push(result); | |
} | |
return newArray; | |
} | |
var start = [1, 2, 3]; |
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
let sortedArray = [0, 1, 1, 2, 4, 18, 23, 23, 28, 30, 30, 30]; | |
let withoutDuplicates = [0, 1, 2, 4, 18, 23, 28, 30]; | |
function checkDuplicates(array) { | |
var newArray = []; | |
for (var i = 0; i < array.length; i++) { | |
if (array[i] !== array[i + 1]) { | |
newArray.push(array[i]); |
NewerOlder