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 { readFile, writeFile } from 'fs/promises'; | |
const inputFile = 'input.txt'; | |
const main = async () => { | |
const input = await readFile(inputFile, 'utf8'); | |
const [queryRaw, parametersRaw] = input.split(' -- PARAMETERS: '); | |
// console.info({ queryRaw, parametersRaw }); | |
const parameters: string[] = JSON.parse(parametersRaw); | |
// console.info({ parameters }); |
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
declare module 'dwolla-v2' { | |
export class Client { | |
apiUrl: string; | |
constructor(args: DwollaClientArgs); | |
delete(uri: string): Promise<DwollaClientResult>; | |
get(uri: string): Promise<DwollaClientResult>; | |
post(uri: string, payload: {}, headers?: DwollaHeaders): Promise<DwollaClientResult>; | |
} | |
export interface DwollaAchResult extends DwollaResultBody { |
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
query ProductInventory { | |
product(id: "product-1") { | |
inventory: { | |
available | |
} | |
} | |
} |
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
type Order { | |
id: ID! | |
productsConnection: OrderProductsConnection! | |
} | |
input OrderInput { | |
lineItems: [OrderLineItemInput!]! | |
paymentToken: String! | |
} |
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
type Inventory { | |
total: Int! | |
available: Int! | |
} | |
extend type Product @key(fields: "id") { | |
id: ID! @external | |
inventory: Inventory! | |
} |
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
####################################################### | |
## Adds some frustration the `cd` command | |
## https://gist.github.com/dncrews/1ba8919b24b2e4569c2f | |
## Author: Dan Crews <crewsd@gmail.com> | |
####################################################### | |
#!/bin/sh | |
alias cd=annoyingCD | |
function annoyingCD () { |
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
var euLocales = [ | |
"de-at", //Austria | |
"fr-be", //Belgium (French) | |
"nl-be", //Belgium (Dutch) | |
"bg", //Bulgaria | |
"el-cy", //Cyprus | |
"cs", //Czech Republic | |
"da", //Denmark | |
"et", //Estonia | |
"fi", //Finland (Finnish) |
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
alias fs="([[ -a Procfile.dev ]] && foreman start -f Procfile.dev) || foreman start" |
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
getCookie : function(cookieID) { | |
var dc = document.cookie, prefix = cookieID + "=", begin = dc.indexOf("; " + prefix); | |
if (begin == -1) { | |
begin = dc.indexOf(prefix); | |
if (begin != 0) | |
return null; | |
} | |
else | |
begin += 2; | |
var end = document.cookie.indexOf(";", begin); |
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
/** | |
* I'm writing this for the purpose of copying all of my local | |
* locale files from all of my node projects that are using | |
* `strong` translation library (https://github.com/fs-webdev/strong) | |
* or (https://github.com/timshadel/strong) to a centralized place | |
* so that I can create a "translation memory". | |
* | |
* Usage: | |
* | |
* node localeCopier.js # from path defaults to "."; to path defaults to "~/Documents/locales" |
NewerOlder