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
| { | |
| "data": { | |
| "firstName": "Foo", | |
| "lastName": "Bar", | |
| "email": "foo@bar.com" | |
| } | |
| } |
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 { Translate } = require('@google-cloud/translate').v2 | |
| const translate = new Translate() | |
| const text = 'Hello, world!' | |
| const target = 'da' | |
| async function translateText() { | |
| // Translates the text into the target language. "text" can be a string for | |
| // translating a single piece of text, or an array of strings for translating | |
| // multiple texts. |
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
| { | |
| "data": { | |
| "id": "5c70a48c318ce30ebd00c14c", | |
| "type": "line_items", | |
| "links": { | |
| "self": "https://foo.example.com/api/line_items/5c70a48c318ce30ebd00c14c" | |
| }, | |
| "attributes": { | |
| "type": "sku", | |
| "sku": "7J237-410", |
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
| <template> | |
| <img :src="srcImage" :loading="loading" :alt="alt"> | |
| </template> | |
| <script> | |
| export default { | |
| props: { | |
| src: { | |
| type: Object, | |
| default: () => ({ |
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
| #!/bin/bash | |
| # . ./backup-files.sh from to | |
| # Variables | |
| WHAT=`date +%d%m%y%H%M%S`.tar.gz | |
| WHERE=gs://$2/$WHAT | |
| SMALLER_ARE_BETTER="tar -czvf $WHAT $1" | |
| targz(){ |
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
| async function foo (method, url, body) { | |
| if (!url) throw new Error() | |
| let config = { | |
| headers: { accept: 'application/json' } | |
| } | |
| if (method && body) { | |
| config.body = JSON.stringify(body) | |
| config.method = method | |
| } | |
| const res = await fetch(url, { config }) |
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
| export default function (func, wait, immediate) { | |
| var timeout | |
| return function() { | |
| var context = this, args = arguments | |
| var later = function() { | |
| timeout = null | |
| if (!immediate) func.apply(context, args) | |
| } | |
| var callNow = immediate && !timeout | |
| clearTimeout(timeout) |
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 fetch = require('node-fetch') | |
| const { FB_PAGE_ID, FB_ACCESS_TOKEN } = process.env | |
| const { getParams } = require('./helpers') | |
| const GRAPH_URL = 'https://graph.facebook.com/v4.0' | |
| const headers = { 'content-type': 'application/json' } | |
| const options = { headers } | |
| let params = { access_token: FB_ACCESS_TOKEN } |
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
| openssl req -x509 -out localhost.crt -keyout localhost.key \ | |
| -newkey rsa:2048 -nodes -sha256 \ | |
| -subj '/CN=localhost' -extensions EXT -config <( \ | |
| printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth") |
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
| # Google Chrome | |
| alias chrome='/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome' | |
| alias chromedoh='chrome --enable-features="dns-over-https<DoHTrial" --force-fieldtrials="DoHTrial/Group1" --force-fieldtrial-params="DoHTrial.Group1:server/https%3A%2F%2F1.1.1.1%2Fdns-query/method/POST"' |