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
#!/bin/sh | |
# Load environment variables from .env file | |
set -a | |
source .env | |
set +a | |
# Start the database container | |
# wait until all healthy | |
docker compose up db -d --wait |
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 * as React from "react"; | |
import { env } from "~/config/env"; | |
const YBUG_SCRIPT_URL = `https://widget.ybug.io/button/${env.VITE_YBUG_ID}.js`; | |
const YbugContext = React.createContext<YbugApi | null>(null); | |
type YbugApi = { | |
boot: () => void; | |
show: (opt?: "launcher") => void; |
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 { prisma } from "~/config/prisma"; | |
async function executeWithoutTransaction(data: Array<{ name: string }>) { | |
return await Promise.all( | |
data.map((d) => prisma.projects.create({ data: d })) | |
); | |
} | |
async function executeWithArrayTransaction(data: Array<{ name: string }>) { | |
return await prisma.$transaction( |
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 {Capacitor} from "@capacitor/core" | |
import { Camera, CameraDirection, CameraResultType, CameraSource } from "@capacitor/camera"; | |
async function takePhoto() { | |
let cameraPermission = {camera: "granted"}; | |
// On web, Camera.requestPermissions is not implemented, we we do it only if we are on a native platform | |
if (Capacitor.isNativePlatform()) { | |
cameraPermission = await Camera.requestPermissions({permissions: ["camera"] }); | |
} | |
if (cameraPermission.camera !== "denied") { |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Ag-Grid Autocomplete Basic Example</title> | |
<script src="https://unpkg.com/[email protected]/dist/ag-grid-community.min.js"></script> | |
<!-- import AutocompleteSelectCellEditor styles --> | |
<link rel="stylesheet" href="https://unpkg.com/[email protected]/main.css"> | |
</head> | |
<body> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Shadow DOM Fixture</title> | |
</head> | |
<body> | |
<div id="host"></div> | |
<script> | |
document | |
.getElementById('host') |
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 {IAfterGuiAttachedParams, ICellEditorComp, ICellEditorParams, IComponent, Promise} from 'ag-grid-community'; | |
export interface ISelectorCellEditor extends ICellEditorParams { | |
highlightAllOnFocus?: boolean; | |
} | |
export interface ISCellEditor extends IComponent<ICellEditorParams>, ICellEditorComp { | |
} | |
export function selectorCellEditorFactory(cellEditor: new(...args: any[]) => (ISCellEditor)) { |
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
#!/bin/bash | |
# Test to run the programme with all availables TERM into the terminal | |
# USAGE: ./script_term_test.sh "./lem-in < maps/test_2.map 1" | |
RED=$(printf "\e[31m") | |
GREEN=$(printf "\e[32m") | |
YELLOW=$(printf "\e[33m") | |
BLUE=$(printf "\e[34m") | |
MAGENTA=$(printf "\e[35m") |
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 columnKeyRegexValidation = /^[a-zA-Z0-9_]+$/; | |
const sequelizeValidOperators = { | |
and: { validation: isDict }, | |
or: { validation: isArrayOfDict }, | |
gt: { validation: isPrimitive }, | |
gte: { validation: isPrimitive }, | |
lt: { validation: isPrimitive }, | |
lte: { validation: isPrimitive }, | |
ne: { validation: isPrimitive }, |
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
#!/usr/bin/python | |
import argparse | |
from gi import require_version | |
require_version('Gdk', '3.0') | |
from gi.repository import Gdk | |
def check_args(): | |
parser = argparse.ArgumentParser(description="Script to toggle the titlebar into Unity windows.") | |
parser.add_argument('-D', '--decorate', help='Decorate window.', |
NewerOlder