View hexcolor.dart
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 'package:flutter/material.dart'; | |
class HexColor extends Color { | |
static int getColorFromHex(String hexColor) { | |
hexColor = hexColor.toUpperCase().replaceAll("#", ""); | |
if (hexColor.length == 6) { | |
hexColor = "FF" + hexColor; | |
} | |
return int.parse(hexColor, radix: 16); | |
} |
View pre-signup.ts
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 { PreSignUpTriggerEvent, PreSignUpTriggerHandler } from 'aws-lambda'; | |
import { CognitoIdentityServiceProvider } from 'aws-sdk'; | |
const cognito = new CognitoIdentityServiceProvider(); | |
const knownProviderNames = { | |
google: 'Google', | |
facebook: 'Facebook' | |
}; |
View executor.js
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
export const waitForMillis = async (millis: number) => { | |
return new Promise(resolve => setTimeout(resolve, millis)); | |
}; | |
export const executor = (concurrency = 100) => { | |
let workers = 0; | |
let index = 0; | |
let queue = []; | |
const waitFor = async () => { |
View dynamodb-graphql-dataloader.ts
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 { DocumentClient } from 'aws-sdk/clients/dynamodb'; | |
import DataLoader from 'dataloader'; | |
export type DynamodbDataloader = DataLoader<GetRequest, DocumentClient.AttributeMap | null> | |
interface GetRequest { | |
TableName: string; | |
Key: DocumentClient.Key; | |
} |
View remark-auto-link.ts
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 remark from 'remark'; | |
import parse from 'remark-parse'; | |
import { Node } from 'unist'; | |
import visit from 'unist-util-visit'; | |
// simple trick to parse links with []() instead of <> | |
const linker = () => (tree: Node) => visit(tree, 'link', node => { | |
node.title = node.title || ''; | |
}); |
View express-dynamic-routes-file-system.js
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
const express = require('express'); | |
const glob = require("glob"); | |
const app = express(); | |
glob.sync('./api/**/*.http.js', { cwd: __dirname }) | |
.forEach(file => { | |
const endpoint = file.split('.http.js').join('') | |
.split('_').join(':') | |
.substr(1); |
View jsWithBinary-GumTreeInfiniteLoop-left.js
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
// --- TreeGrid Header --- | |
Component = { | |
// --- File information --- | |
Name: "Editable JavaScript TreeGrid", | |
Address: "http://www.treegrid.com", | |
Type: "TreeGrid with Gantt chart with Extended API", | |
Version: "9.2.12", | |
Release: "3. June 2013 10:52", |