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
//Related: coderrocketfuel.com/article/fix-404-error-when-using-react-rouder-dom-and-nginx | |
FROM nginx:stable-alpine | |
COPY --from=build /app/build /usr/share/nginx/html | |
>>>>>>>RUN sed -i 's/index index.html index.htm/try_files $uri \/index.html/g' /etc/nginx/conf.d/default.conf | |
EXPOSE 80 |
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 methods aims to be used on a testing database. It's extremely harmful, proceed with caution | |
public static class DatabaseContextHelper | |
{ | |
public static readonly string DisableTablesConstraintsCommand = "EXEC sp_MSForEachTable 'ALTER TABLE ? NOCHECK CONSTRAINT ALL' "; | |
public static readonly string DeleteAllTablesDataExceptMigrationsTableCommand = "EXEC sp_MSforeachtable 'if (\"?\" NOT IN (\"[dbo].[__EFMigrationsHistory]\")) DELETE FROM ?'"; | |
public static readonly string EnableTablesConstraintsCommand = "EXEC sp_MSForEachTable 'ALTER TABLE ? WITH CHECK CHECK CONSTRAINT ALL'"; | |
public static void DeleteAllDataExceptMigrations(this DbContext context) | |
{ |
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
//live example at: https://playcode.io/448394 | |
var makeColors = () => { | |
var minNum = 0; | |
var maxNum = 9; | |
var minLet = 65; | |
var maxLet = 71; | |
function randomNumber() { |
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
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
class Solution | |
{ | |
static int[] solve(int a0, int a1, int a2, int b0, int b1, int b2) | |
{ | |
int[] tripletAlice = { a0, a1, a2 }; |