You can fix that by following these steps:
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 getDaterangeOneMonth = () => { | |
let date = new Date(); | |
let dateLater = new Date(); | |
dateLater.setDate(date.getDate() + 30); | |
return `${date.toISOString().split("T")[0]} - ${dateLater.toISOString().split("T")[0]}`; | |
} | |
console.log(getDaterangeOneMonth); // 2021-10-25 - 2021-11-24 |
This does not contain a common SQL Query, maybe I will add it in the future. it still just contains any command that is commonly used via terminal
/console
.
Table of contents:
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
# refresh local branches to remote server | |
git remote update origin --prune | |
# remove cloned branch item | |
# remove staged branch item | |
git rm -rf | |
# remove files in origin after add it to .gitignore | |
# remove cached file in origin | |
git rm --cached file1.txt |
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
<div class="container pt-5"> | |
<div class="row"> | |
<div class="col-lg-8"> | |
<form class="form-validate-summernote"> | |
<div class="form-group"> | |
<label>Name</label> | |
<input class="form-control" name="form2-name" type="text" required="required" data-msg="Please enter your name"/> | |
</div> | |
<div class="form-group"> | |
<label>Text</label> |
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
let string = <?php echo "`" . trim(preg_replace('/\s\s+/', ' ', nl2br($summary_notes[$whoami]['text']))) . "`"; ?>; | |
console.log(string); |
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
// generates random words | |
function createRandomWord(length) { | |
var consonants = 'bcdfghjlmnpqrstv', | |
vowels = 'aeiou', | |
rand = function(limit) { | |
return Math.floor(Math.random()*limit); | |
}, | |
i, word='', length = parseInt(length,10), | |
consonants = consonants.split(''), | |
vowels = vowels.split(''); |
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
<?php | |
namespace App\Console\Commands; | |
use Illuminate\Console\Command; | |
use Illuminate\Support\Facades\Artisan; | |
class RefreshDatabaseCommand extends Command | |
{ |
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
Swal.fire({ | |
title: 'Form Validation Error', | |
html: "Please fill the required input form.", | |
icon: 'warning', | |
showCancelButton: false, | |
// confirmButtonColor: '#99FF99', | |
// cancelButtonColor: '#d33', | |
confirmButtonText: 'Ok, I wiil check it.', | |
allowOutsideClick: false, | |
allowEscapeKey: false, |
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
<?php | |
// add some classes or add this function to your class | |
public function convertToCsv(){ | |
$file = fopen(base_url('mycsv.csv'), 'r'); // take file location | |
$arr = array(); $x = 0; $index = array(); // prepare variable for container and index | |
while (($line = fgetcsv($file)) !== FALSE) { // iteration on each line of csv | |
//$line is an array of the csv elements | |
if($x == 0){ // for the first line, use it as index | |
foreach($line as $k => $v){ // iterate the first line |