Skip to content

Instantly share code, notes, and snippets.

View MarcusHurney's full-sized avatar

Marcus Hurney MarcusHurney

View GitHub Profile
@MarcusHurney
MarcusHurney / Address.test.tsx
Last active September 28, 2021 14:57
Generate Viewing Key Test
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)
}
@MarcusHurney
MarcusHurney / gql-syntax.js
Created July 13, 2020 22:35
Why have the extra wrapper and parameter type declaration with GQL queries and mutations?
query ProjectOwner($login: String!) {
projectOwner(login: $login) {
websiteUrl
}
}
"vs"
query projectOwner(login: String!) {
websiteUrl
div {
position: relative;
overflow: hidden;
padding-top: 56.25%;
}
iframe {
position: absolute;
top: 0;
left: 0;

Keybase proof

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:

// inside button click handler
saveNotes(removeNote(id))
const removeNote = id => notes.filter(note => note.id !== id);
// @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';
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];
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]);