Skip to content

Instantly share code, notes, and snippets.

View ryumada's full-sized avatar
🤔
What should I code?

Rizuki Ryumada ryumada

🤔
What should I code?
  • garasijogi
  • Indonesia
View GitHub Profile
@ryumada
ryumada / jquery-swal-scroll.js
Last active November 13, 2020 06:46
this is jquery script to scroll on swal modal close.
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,
@ryumada
ryumada / laravel-call-other-command.php
Last active January 20, 2021 10:44
Using call command to call single seeder file on laravel 7
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Artisan;
class RefreshDatabaseCommand extends Command
{
@ryumada
ryumada / generate_words.js
Created January 24, 2021 02:26
Generate any title words with javascript
// 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('');
@ryumada
ryumada / javascript-php-html-char-escape.js
Created February 1, 2021 13:37
print html native tag to javascript variable using php echo
let string = <?php echo "`" . trim(preg_replace('/\s\s+/', ' ', nl2br($summary_notes[$whoami]['text']))) . "`"; ?>;
console.log(string);
@ryumada
ryumada / index.html
Created February 2, 2021 01:41
summernote jquery validation and swal toast
<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>
@ryumada
ryumada / git-shell-commands.sh
Last active September 27, 2021 09:22
Important git shell commands
# 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
@ryumada
ryumada / sql-CheatSheet.md
Last active October 5, 2021 01:50
My SQL Cheatsheet
@ryumada
ryumada / office_word-fix_blackedout_numbering.md
Last active November 8, 2021 04:59
Fix blacked out numbering in microsoft word

You can fix that by following these steps:

  1. Place your cursor into the styles with blacked-out numbering. image

  2. Press ctrl + shift + S, then a popup will be showed up like the screenshot below image

  3. Without changing anything, just press reapply button and your numbering will be back to normal again.

  4. If not, you must remake again your multilevel list

@ryumada
ryumada / daterange_oneMonthLater.js
Last active October 25, 2021 02:45
get daterange one month javascript
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
@ryumada
ryumada / psql-basic_command.md
Last active October 2, 2023 09:51
basic psql commands cheatsheet PostgreSQL

basic psql commands for easy read

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