| commands | description |
|---|---|
GRANT ALL PRIVILEGES ON DATABASE <<nama database>> TO <<nama user>>; |
Query to grant All Previledges to a user |
sudo -u postgres psql |
Linux ubuntu login to superadmin |
CREATE USER <<nama user>> WITH ENCRYPTED PASSWORD '<<password>>'; |
Query to create user |
\l |
get database list in the postgres server |
\c database_name |
connect to a database (You need to connect to a database first before you can run the below commands) |
\d table_name |
show table details |
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 |
You can fix that by following these steps:
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, |

