View REMOVE NODE_MODULES
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
find . -name "node_modules" -type d -prune -print -exec rm -rf '{}' \ ; | |
OR | |
rm -rf $(find / -type d -name node_modules); | |
OR | |
rm -rf $(find . -name "node_modules" -type d -prune -print -exec rm -rf '{}' \ ); |
View RANDOM NUMBER IN PHP
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 | |
$date = date("Y-m-d H:i:s"); | |
$day_number = date('N', strtotime($date)); | |
echo $day_number; | |
echo "\n";echo "===="; echo "\n"; | |
echo ($day_number % 2 == 0) ? '1' : '2'; | |
echo "\n"; | |
function generateRandomBot($min = 1, $max = 2) | |
{ |
View Top 10 Interview Questions with Coding Examples 2023
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
What is closure in JavaScript and how does it work? | |
Answer: Closure is a feature in JavaScript where a function has access to its outer scope even after the outer function has returned. It is created when a function is defined inside another function, and the inner function retains access to the variables in the outer function's scope. | |
Can you explain hoisting in JavaScript? | |
Answer: Hoisting is a behavior in JavaScript where variable and function declarations are moved to the top of their scope, regardless of where they are declared in the code. This means that variables and functions can be called before they are declared, but the value of variables will be undefined until they are assigned a value. | |
What is the difference between == and === in JavaScript? |
View USER MYSQL
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
``` | |
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password'; | |
GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' WITH GRANT OPTION; | |
CREATE USER 'username'@'%' IDENTIFIED BY 'password'; | |
GRANT ALL PRIVILEGES ON *.* TO 'username'@'%' WITH GRANT OPTION; | |
FLUSH PRIVILEGES; |
View VITE JS ANTD
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
https://segmentfault.com/a/1190000041225133/en |
View MUI-WIZARD-FORM
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
https://dev.to/paulvermeer2021/turn-any-form-into-a-stepper-form-wizard-with-ui-hooks-context-react-hook-form-and-yup-56j6 | |
https://codesandbox.io/s/cranky-monad-52bh5w | |
https://blog.logrocket.com/building-multi-step-wizards-with-formik-and-react-query/ | |
https://codesandbox.io/s/wizard-form-with-formik-forked-n7uxd9?file=/package.json | |
View BACKUP DB MYSQL DUMP
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->load->helper(array('url','file','download')); | |
$this->load->library('zip'); | |
$website = $this->load->database('website', TRUE); // the TRUE paramater tells CI that you'd like to return the database object. | |
$DBUSER=$website->username; | |
$DBPASSWD=$website->password; | |
$DATABASE=$website->database; | |
$HOSTNAME=$website->hostname; |
View BACKUP DB CI
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
system\database\drivers\mysqli\mysqli_utility.php | |
``` | |
/** | |
* MySQLi Export | |
* | |
* @access private | |
* @param array Preferences | |
* @return mixed | |
* @source https://stackoverflow.com/a/44667873 | |
*/ |
View bash-rename
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
source: | |
1. https://medium.com/@sheniff/using-shell-to-rename-files-in-bulk-ee657f1a06 | |
2. https://gist.github.com/mustafaturan/32df16bb4c49fbd837f777000f4b9aa2?permalink_comment_id=3837386#gistcomment-3837386 | |
How to: | |
1. Create file, ex: renamejstojsx.sh copy paste from source:#1 | |
2. In your project open bash or Cmder as Terminal execution | |
3. Run ```bash renamejstojsx.sh``` | |
4. Done, sruput coffe again. |
View datetime
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
https://stackoverflow.com/a/1296398/1852097 | |
https://stackoverflow.com/a/67553979/1852097 | |
```javascript | |
var dateOffset = (24*60*60*1000) * 12775; //5 days | |
var myDate = new Date(); | |
console.log(dateOffset); | |
``` | |
https://unitconverter.io/years/days/35 |
NewerOlder