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 | |
# Initialize MySQL database. | |
# ADD this file into the container via Dockerfile. | |
# Assuming you specify a VOLUME ["/var/lib/mysql"] or `-v /var/lib/mysql` on the `docker run` command… | |
# Once built, do e.g. `docker run your_image /path/to/docker-mysql-initialize.sh` | |
# Again, make sure MySQL is persisting data outside the container for this to have any effect. | |
set -e | |
set -x |
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
from sqlalchemy import (String, | |
Integer, | |
engine_from_config, | |
Column) | |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy.orm import sessionmaker | |
Base_1 = declarative_base() | |
Base_2 = declarative_base() |
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
{ | |
"repository": {}, | |
"description": " ", | |
"license": "MIT", | |
"scripts": { | |
"deploy": "webpack --mode production", | |
"watch": "webpack --mode development --watch" | |
}, | |
"dependencies": { | |
"@tailwindcss/forms": "^0.2.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
#!/usr/bin/env bash | |
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done | |
git fetch --all | |
git pull --all |
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 { FC, useEffect } from "react"; | |
import { BulkDeleteButton, BulkExportButton, Loading } from "react-admin"; | |
import { useSelector } from "react-redux"; | |
import { useQuery } from "react-query"; | |
import { reservationAPI } from "@/api"; | |
import { ReservationStatus } from "@/utils/typing/reservation"; | |
import { GetListResult } from "ra-core/esm/types"; | |
import { forkJoin, from, Observable, of } from "rxjs"; | |
import { csDataProvider, User } from "@/utils"; |
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 React from "react"; | |
import logo from "./logo.svg"; | |
import { useState } from "react"; | |
import "./App.css"; | |
function App() { | |
const [number, setNumber] = useState(); | |
const highestPrime = (num: number) => { | |
for (let i = num; i > 2; i--) { |
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
pylint --rcfile=.pylintrc backend/**/*.py -r y |
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
# ref: | |
# https://wiki.openssl.org/index.php/Command_Line_Elliptic_Curve_Operations | |
# https://stackoverflow.com/questions/15686821/generate-ec-keypair-from-openssl-command-line | |
# openssl ec help | |
# 1.1 generate private key in EC format: | |
openssl ecparam -name secp384r1 -genkey -noout -out auth-private.ec.key | |
# 1.2 convert EC format to a non-encrypted PKCS8 format: | |
openssl pkcs8 -topk8 -nocrypt -in auth-private.ec.key -out auth-private.pem |
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
user www-data; | |
worker_processes auto; | |
pid /run/nginx.pid; | |
include /etc/nginx/modules-enabled/*.conf; | |
events { | |
worker_connections 768; | |
# multi_accept on; | |
} |
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 path = require("path"); | |
const HtmlWebpackPlugin = require("html-webpack-plugin"); | |
const LinkTypePlugin = require("html-webpack-link-type-plugin") | |
.HtmlWebpackLinkTypePlugin; | |
const BundleAnalyzerPlugin = require("webpack-bundle-analyzer") | |
.BundleAnalyzerPlugin; | |
const MiniCssExtractPlugin = require("mini-css-extract-plugin"); | |
const { CleanWebpackPlugin } = require("clean-webpack-plugin"); | |
const CopyPlugin = require("copy-webpack-plugin"); | |
const Dotenv = require("dotenv-webpack"); |