CREATE TYPE price AS ("amount" float, "currency" char(3));
CREATE TYPE vat AS ("base" float, "amount" float, "rate" smallint);
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
| // this is just sync relevant snippet from the DO integration as it's heavily customised otherwise | |
| const synchronizer = createCustomSynchronizer( | |
| this.store, | |
| (targetActorId, requestId, message, body) => | |
| createMessages(targetActorId, requestId, message, body).map((message) => | |
| this.handleMessage(SERVER_ACTOR_ID, message), | |
| ), | |
| (receive: Receive) => { | |
| this.forwardToServerActor = async (message: 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
| // Javascript. | |
| const one = async () => { | |
| // Simulate a workload. | |
| sleep(Math.floor(Math.random() * Math.floor(2000))) | |
| return 1 | |
| } | |
| const two = async () => { | |
| // Simulate a workload. |
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 DataLoader from 'dataloader' | |
| import { Exchange, Operation } from 'urql' | |
| import { pipe, map } from 'wonka' | |
| interface BatchRequest { | |
| url: string | |
| options?: RequestInit | |
| } | |
| const batchFetch = ( |
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
| npm outdated | awk '{if (NR!=1) {print $1 "@latest"}}' | xargs npm i |
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 {patchApolloHints} from './patchApollo' | |
| const apolloConfig = { | |
| formatResponse: (response, options) => { | |
| patchApolloHints(response) | |
| // and some more stuff | |
| }, | |
| cacheControl: true | |
| } |
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
| // Simplified version how we inject JWT AccessToken into panva/oidc-provider | |
| const provider = new Provider(...) | |
| function getTokenData () { | |
| const authorization = _.get(this, 'claims._authorization', {}) | |
| return { | |
| ...authorization, | |
| ...(_.omit(this, ['claims'])) | |
| } |
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
| # Authors | |
| git ls-files | grep "yarn.lock" -v | grep "package-lock.json" -v | while read f; do git blame --line-porcelain $f | grep '^author '; done | sort -f | uniq -ic | sort -n | |
| # Size of repository | |
| git ls-files | grep "yarn.lock" -v | grep "package-lock.json" -v | while read f; do git blame --line-porcelain $f | grep '^author '; done | wc -l |
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
| location / { | |
| proxy_set_header Host arrivacz-custom.bileto.com; | |
| proxy_ssl_verify off; | |
| proxy_ssl_session_reuse off; | |
| proxy_ssl_server_name on; | |
| proxy_pass https://arrivacz-custom.bileto.com; | |
| # try_files $uri $uri/ =404; |
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
| docker ps | awk '{print $1}' | sed -n -e '/[^CONTAINER]/p' | xargs docker stats |
NewerOlder