-
PaperCut
-
eBay
-
Karat
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
| import base64 | |
| encoded_string = base64.b64encode(bytes(string, 'utf-8')) | |
| # source: https://stackoverflow.com/questions/21478086/how-to-store-binary-data-in-dynamo-with-boto | |
| email_addreses = [base64.b64decode(item['EmailAddress'].value).decode('utf-8') for item in queried_items] |
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
| parens_table = str.maketrans(dict.fromkeys("()")) | |
| # remove parens | |
| converted = converted.translate(parens_table) | |
| return converted |
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
| import { configureStore } from '@reduxjs/toolkit' | |
| export interface AccountState { | |
| readonly isInitialized: boolean | |
| readonly isLoading: boolean | |
| readonly isAuthenticated: boolean | |
| readonly errorMessage?: string | |
| } | |
| /** |
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
| import re | |
| def batch_data(Items, size): | |
| result = [] | |
| i = 0 | |
| while (i < len(Items)): | |
| batch = Items[i:i + size] | |
| result.append(batch) | |
| i = i + size | |
| return result |
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 generateHeader = (header) => { | |
| const newHeader = header.map(key => { | |
| const replacement = headerMappings[key] === undefined ? key : headerMappings[key] | |
| return replacement | |
| }) | |
| return newHeader | |
| } | |
| const convertArrayOfObjectsToCSV = arrayOfObjects => { |
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 AWS = require('aws-sdk') | |
| AWS.config.update({ | |
| region: "<region>", | |
| }); | |
| const s3 = new AWS.S3() | |
| const docClient = new AWS.DynamoDB.DocumentClient(); | |
| const xlsx = require('node-xlsx') | |
| const testfilename = "<file>.xlsm" | |
| // src: https://stackoverflow.com/questions/40535757/download-xlsx-from-s3-and-parse-it |
- Usage
[reagent.core :as r]
[:<> [*components*]]= JSX Fragment for Reagent[:> *Component*]= shorthand for[(r/adapt-react-class *Component*)][:> *Component* {:variant "some-prop"} "Click me"]= send JSX element properties as a map(js->clj myobj :keywordize-keys true)= parse JSON to Clojure map (I think)
NewerOlder