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 supabase = useMemo(() => { | |
return createClient( | |
process.env.NEXT_PUBLIC_SUPABASE_URL!, | |
process.env.NEXT_PUBLIC_SUPABASE_KEY!, | |
{ | |
global: { | |
headers: { | |
telegram_init_data: initDataRaw || "", | |
}, | |
}, |
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 9 columns, instead of 6 in line 7.
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
city 1, city 2 distance, city 2, city 3 distance, city 3, city 4 distance, city 4, city 5 distance, city5 | |
Bronx , 23 , Brooklyn , 11 , Manhattan , 18 , New York , 13 , Queens | |
Bronx , 23 , Brooklyn , 11 , Manhattan , 13 , Queens , 18 , New York | |
Bronx , 23 , Brooklyn , 18 , New York , 11 , Manhattan , 13 , Queens | |
Bronx , 23 , Brooklyn , 18 , New York , 13 , Queens , 11 , Manhattan | |
Bronx , 23 , Brooklyn , 13 , Queens , 11 , Manhattan , 18 , New York | |
Bronx , 23 , Brooklyn , 13 , Queens , 18 , New York , 11 , Manhattan | |
Bronx , 11 , Manhattan , 23 , Brooklyn , 1 |
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 Script from 'next/script' | |
// Add this file to some Server Component, in my case I use this in `app/layout.tsx` | |
// Next.js, will inline all the process.env.SOMETHING variables into the code at build time. | |
// Which will force us to build the app for each environment we want to deploy to, with the | |
// only different being few environment variables. Instead, what we want is to get the environment | |
// dynamically from the runtime, so if we change them in the env and run the app again, it must | |
// use the new environment variables. To do this, we will inject the environment variables into | |
// the window object, so we can access them in the runtime. |
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 function bigIntP(value: bigint, percentage: number, scalingFactor = 1000000000): bigint { | |
const scaledPercentage = BigInt(Math.round(percentage * 100 * scalingFactor)) | |
const result = (value * scaledPercentage) / (BigInt(100) * BigInt(scalingFactor)) | |
return result | |
} |
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 'types/schemas/knex-tables' | |
import { Tables } from 'knex/types/tables' | |
type TableColumns<TTableName extends keyof Tables = keyof Tables> = { | |
[T in TTableName]: (keyof Tables[T]['base'])[] | |
} | |
const deleteColumns: Partial<TableColumns> = { | |
users: ['name'], | |
} |
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 type { PgCodec } from '@dataplan/pg'; | |
import { EXPORTABLE } from 'graphile-build'; | |
import { sql } from 'pg-sql2'; | |
import { Geometry } from 'wkx'; | |
interface State { | |
geometryCodec: PgCodec<string, any, any, any, undefined, any, any>; | |
} | |
declare global { |
OlderNewer