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
async function() { | |
try { | |
const someValue = await getSomeValue(); | |
doSomethingWith(someValue); | |
} catch (error) { | |
console.error(error); | |
} | |
} | |
async 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 crypto from 'crypto'; | |
// Docs: https://docs.adyen.com/developers/payments/accepting-payments/hmac-signature-calculation | |
export default function generateSignature(body, hmacKey) { | |
const keys = Object | |
.keys(body) | |
// Step 1: Sort by keys | |
.sort(); | |
const values = keys |
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
function reducer(state, action) { | |
switch (action.type) { | |
case UPDATE_VOTES: | |
const updateVotesList = state.polls.map((poll, ind) => { | |
if (ind === action.question) { | |
return poll.answers.map((ans, index) => | |
index === action.index | |
? { ...ans, votes: ans.votes + action.votes } | |
: ans; | |
); |
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
correct = [0, 0, 0]; | |
incorrect = [0, 0, 0]; | |
for i in range(10000): | |
(correct if train_data.correct[i] == 1 else incorrect)[train_data.group_name[i]].append(1); | |
plt.hist(correct[0], color='blue', label='correct_0') | |
...etc |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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 React from "react"; | |
import { notify } from '@vendure/ui-devkit'; | |
import { gql } from 'graphql-tools'; | |
import { useGetProductsLazyQuery, useToggleEnabledMutation } from './generated-by-codegen'; | |
// These queries get detected and processed by graphql-codegen | |
const GET_PRODUCTS = gql` | |
query GetProducts($skip: Int, $take: Int) { | |
products(options: { skip: $skip, take: $take }) { | |
items { id, name, enabled }, |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
OlderNewer