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 pg from 'pg'; | |
const dbHost = process.env.DB_HOST; | |
const dbPort = process.env.DB_PORT; | |
const dbUser = process.env.DB_USER; | |
const dbPassword = process.env.DB_PASSWORD; | |
const country = process.env.COUNTRY; | |
const { Client } = pg; |
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 pg from 'pg'; | |
const { Client } = pg; | |
const dbUrl = 'postgresql://USERNAME:[email protected]:15432'; | |
const buynana = new Client(`${dbUrl}/api_buynana_co`); | |
const coordinators = new Client(`${dbUrl}/api_coordinators_co`); | |
async function main() { |
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 { Constructor } from '@mikro-orm/core'; | |
import { EntityManager } from '@mikro-orm/core'; | |
export async function truncate(em: EntityManager, entities: Constructor[]) { | |
const meta = em.getMetadata(); | |
for (const entity of entities) { | |
const entityMeta = meta.get(entity.name); | |
if (!entityMeta) { |
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 { useRouter } from 'next/router'; | |
import { ParsedUrlQuery, ParsedUrlQueryInput } from 'querystring'; | |
import { useEffect, useMemo, useState } from 'react'; | |
// common defs | |
export const numParam: ParamDef<number> = { | |
encode: (value) => value.toString(), | |
decode: (value) => (typeof value === 'string' && value ? parseInt(value, 10) : undefined), | |
}; |
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 { useRouter } from 'next/router'; | |
export const locales = ['it', 'en'] as const; | |
export type Locale = typeof locales[number]; | |
export const isLocale = (locale: string): locale is Locale => { | |
return (locales as unknown as string[]).includes(locale); | |
}; |
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
# This script copies the right firebase configuration ( GoogleService-Info.plist file ) for the running flavor. | |
# It must be run as a Build Phase. It assumes three flavors: "dev", "stage" and "prod". | |
if [ "${CONFIGURATION}" == "Debug-prod" ] || [ "${CONFIGURATION}" == "Release-prod" ] || [ "${CONFIGURATION}" == "Profile-prod" ]; | |
then | |
cp -r "${PROJECT_DIR}/Runner/Firebase/prod/GoogleService-Info.plist" "${PROJECT_DIR}/Runner/GoogleService-Info.plist" | |
elif [ "${CONFIGURATION}" == "Debug-stage" ] || [ "${CONFIGURATION}" == "Release-stage" ] || [ "${CONFIGURATION}" == "Profile-stage" ]; | |
then | |
cp -r "${PROJECT_DIR}/Runner/Firebase/stage/GoogleService-Info.plist" "${PROJECT_DIR}/Runner/GoogleService-Info.plist" | |
elif [ "${CONFIGURATION}" == "Debug-dev" ] || [ "${CONFIGURATION}" == "Release-dev" ] || [ "${CONFIGURATION}" == "Profile-dev" ]; |
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
SELECT pg_size_pretty( pg_database_size('DB_NAME') ); |
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
buildscript { | |
repositories { | |
google() | |
jcenter() | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:3.3.1' | |
classpath 'com.google.gms:google-services:3.2.1' | |
} |
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
DC_COMMON = ./config/common/docker-compose.yaml | |
DC_DEV = ./config/dev/docker-compose.yaml | |
dev: ${DC_COMMON} ${DC_DEV} | |
docker-compose -f ${DC_COMMON} -f ${DC_DEV} -p suma up | |
dev-build: ${DC_COMMON} ${DC_DEV} | |
docker-compose -f ${DC_COMMON} -f ${DC_DEV} -p suma up --build |
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
<?php | |
// Sedi Custom Post Type | |
class Sedi_Cpt { | |
public function __construct() | |
{ | |
add_action( 'init', array( $this, 'build_custom_post_type' ), 0 ); | |
add_action( 'init', array( $this, 'build_aree_taxonomy' ), 0 ); | |
add_action( "add_meta_boxes", array( $this, "build_meta_boxes" ) ); |
NewerOlder