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 | |
namespace App\Helper\ValidatorExtensions; | |
use Illuminate\Support\Facades\Validator; | |
/** | |
* Validator Extension registration on Laravel AppServiceProvider.php: | |
* => Validator::extend('is_base64_image_data', 'App\Helper\ValidatorExtensions\Base64DataUri@validate'); | |
* => Validator::replacer('is_base64_image_data', 'App\Helper\ValidatorExtensions\Base64DataUri@replacer'); | |
* Usage on Controller: |
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
version: '3.1' | |
# reference: | |
# - docker mssql notes: https://docs.docker.com/storage/volumes/ | |
# - setup mssql docker linux named volumes: https://dbafromthecold.com/2019/03/21/using-docker-named-volumes-to-persist-databases-in-sql-server/ | |
# - run docker mssql: https://medium.com/@reverentgeek/sql-server-running-on-a-mac-3efafda48861 | |
services: | |
mssql-db: | |
image: mcr.microsoft.com/mssql/server:latest |
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
def round_multiply_by_factor(factor: float = 0, input_value: float = 0 ) -> float: | |
fix = False | |
x= input_value | |
y= 1.0 | |
while fix == False: | |
if x <= (y * factor): | |
x= y * factor | |
fix = True | |
y+=1 | |
return x |
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
const dotenv = require('dotenv'); | |
dotenv.config(); | |
const fs = require('fs'); | |
const approot = require('app-root-path'); | |
const _ = require('lodash'); | |
const ConfigStore = require('configstore'); | |
const app_name = process.env.APP_NAME || 'app_config'; | |
const config_path = process.env.APP_CONFIG_PATH || approot + '/config'; | |
const readdir_mode = process.env.APP_CONFIG_READDIR_MODE || 'recursive'; |
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
const execSync = require('child_process').execSync; | |
const _ = require('lodash'); | |
const asyncjs = require('async'); | |
const sequelizeCliExec = (command) => { | |
let commands=[ | |
'db:drop', | |
'db:create', | |
'db:migrate', | |
'db:migrate:undo:all', |
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
'use strict'; | |
//# check required modules | |
var module_exists = require('module-exists'); | |
var required_modules=['js-rijndael', 'base64-js', 'lodash']; | |
var valid_requirement=required_modules.length; | |
var not_exist_module=[]; | |
required_modules.forEach(function(em){ | |
if(module_exists(em) === false){ | |
valid_requirement--; |
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 | |
/* | |
|-------------------------------------------------------------------------- | |
| Detect The Application Environment | |
|-------------------------------------------------------------------------- | |
| | |
| Laravel takes a dead simple approach to your application environments | |
| so you can just specify a machine name for the host that matches a | |
| given environment, then we will automatically detect it for you. |