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 { PutObjectCommand, S3Client } from '@aws-sdk/client-s3'; | |
import { | |
MetadataAttributeType, | |
ProfileMetadataSchema, | |
profile, | |
} from '@lens-protocol/metadata'; | |
import { v4 as uuidv4 } from 'uuid'; | |
import { z } from 'zod'; | |
import { env } from '~/env'; |
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: Flightcontrol Webhook Deployment | |
env: | |
DEPLOYMENT_URL: "" | |
on: workflow_dispatch | |
jobs: | |
backend-deploy: | |
runs-on: ubuntu-latest | |
timeout-minutes: 25 | |
steps: |
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 type { NextApiRequest, NextApiResponse } from "next" | |
import { withSentry } from "@sentry/nextjs" | |
import { BUILD_ID } from "constants/frontend" | |
const handler = (_req: NextApiRequest, res: NextApiResponse) => { | |
res.status(200).json({ | |
buildId: BUILD_ID, | |
}) | |
} |
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
// The `CreateCollection` is similar to `CREATE TABLE ` in SQL. The same for `CreateIndex`. | |
CreateCollection({name: "artists"}); | |
CreateCollection({name : "songs"}); | |
CreateCollection({name : "albums"}); | |
// We are emulating the primary keys of each respective table by specifying unique as true. | |
CreateIndex({name : "artists_by_id", source : Collection("artists"), terms : [ {field : [ "data", "artist_id" ]} ], unique : true}) | |
CreateIndex({name : "songs_by_id", source : Collection("songs"), terms : [ {field : [ "data", "song_id" ]} ], unique : true}) |
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
getParameterByName(name: string, url: string) { | |
if (!url) { url = window.location.href; } | |
name = name.replace(/[\[\]]/g, '\\$&'); | |
const regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'), | |
results = regex.exec(url); | |
if (!results) { return null; } | |
if (!results[2]) { return ''; } | |
return decodeURIComponent(results[2].replace(/\+/g, ' ')); | |
} |
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
for (var i=1; i <= 100; i++) { | |
if (i % 15 == 0) | |
console.log("FizzBuzz"); | |
else if (i % 3 == 0) | |
console.log("Fizz"); | |
else if (i % 5 == 0) | |
console.log("Buzz"); | |
else | |
console.log(i); |
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 numeralCodes = [["","I","II","III","IV","V","VI","VII","VIII","IX"], // Ones | |
["","X","XX","XXX", "XL", "L", "LX", "LXX", "LXXX", "XC"], // Tens | |
["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM"]]; // Hundreds | |
function convert(num) { | |
var numeral = ""; | |
var digits = num.toString().split('').reverse(); | |
for (var i=0; i < digits.length; i++){ | |
numeral = numeralCodes[i][parseInt(digits[i])] + numeral; | |
} |
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
function ordinalSuffix(i) { | |
const j = i % 10, | |
k = i % 100; | |
if (j === 1 && k !== 11) { | |
return i + 'st'; | |
} | |
if (j === 2 && k !== 12) { | |
return i + 'nd'; | |
} | |
if (j === 3 && k !== 13) { |
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
$('a[href*="#"]:not([href="#"], [href="#carousel"])') | |
.click(function() { | |
if (location.pathname.replace(/^\//, '') === | |
this.pathname.replace(/^\//, '') && | |
location.hostname === this.hostname) { | |
var target = $(this.hash); | |
target = target.length ? target : | |
$('[name=' + this.hash.slice(1) + ']'); | |
if (target.length) { | |
$('html, body').animate({ |
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
$ brew install putty | |
Place the two keys in the .ssh folder in the user directory. | |
Now convert the PPK keys to SSH keypairs | |
$ cd ~/.ssh | |
Private key generation: | |
$ puttygen id_rsa.ppk -O private-openssh -o id_rsa |