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 fetch from "node-fetch"; | |
import ProgressBar from "progress"; | |
// Function to handle the individual fetch operation | |
async function sendRequest(url, index) { | |
try { | |
// console.log(`Sending request ${index + 1} to ${url}`); | |
const startTime = process.hrtime(); // Start timing here | |
const response = await fetch(url); | |
const duration = process.hrtime(startTime); |
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 {ZuploContext, ZuploRequest} from "@zuplo/runtime"; | |
export default async function policy( | |
request: ZuploRequest, | |
context: ZuploContext, | |
options: never, | |
policyName: string | |
) { | |
context.custom.originalQuery = request.query; |
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 { | |
ZuploContext, | |
ZuploRequest, | |
OpenIdJwtInboundPolicy, | |
InboundPolicyHandler, | |
OpenIdJwtInboundPolicyOptions, | |
Auth0JwtInboundPolicy, | |
Auth0JwtInboundPolicyOptions, | |
} from "@zuplo/runtime"; |
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 { ZuploContext, ZuploRequest } from "@zuplo/runtime"; | |
import environment from "@app/environment"; | |
import { parse, visit } from "graphql"; | |
import { BQWriter } from "./bg-writer"; | |
interface LoggingEntry { | |
url: string; | |
method: 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
import { getTokenFromGCPServiceAccount } from "@sagi.io/workers-jwt"; | |
import { Logger, ZuploContext } from "@zuplo/runtime"; | |
const aud = "https://bigquery.googleapis.com/"; | |
export class BQWriter<T> { | |
constructor(serviceAccountJson: string, projectId: string, datasetId: string, tableId: string) { | |
this.#serviceAccountJson = JSON.parse(serviceAccountJson); | |
this.#insertUrl = `${aud}bigquery/v2/projects/${projectId}/datasets/${datasetId}/tables/${tableId}/insertAll`; |
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 default async () => { | |
const response = await fetch('https://your-api.com'); | |
const transformed = await transformBody(response); | |
return transformed; | |
} |
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
## GoPro Fusion Script to move files into grouped folders | |
# Where do you want your files moved to? | |
$targetFolder = "D:\GoPro Fusion\" | |
# For easiest workflow, just set the friendly/file system label for your front and back SD cards to "FusionSD" | |
$volumes = Get-Volume | Where FileSystemLabel -eq "fusionsd" | |
#### ==== support functions |
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
[ | |
{ | |
"name": "Logger1", | |
"source": "https://gist.githubusercontent.com/joshtwist/93ed4ad55f814021c3a9fb45af98222d/raw/a0547371300d37290bc8527b1717105f591b567d/test.js", | |
"config": { | |
"appid": 123456 | |
} | |
}, | |
{ | |
"name": "Logger2", |
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 config; | |
module.exports.init = function(config) { | |
utils.log("L2Configuration recevied"); | |
utils.log(config); | |
config = config; | |
} | |
module.exports.log = function(message, params) { | |
utils.log("L2 Message :" + message); |
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
module.exports.init = function(config) { | |
utils.log("Configuration recevied"); | |
utils.log(config); | |
} | |
module.exports.log = function(message, params) { | |
utils.log("Message :" + message); | |
utils.log("Params :" + params); | |
} |
NewerOlder