- cd /path/to/your/project
- mkdir data
- mongod --dbpath /path/to/your/project
- A bunch of text should appear, you will see "I NETWORK [initandlisten]" alot;
- type "mongo" and press enter
- MongoDB shell version: your-mongo-version connecting to: test should be appear in your console. If not, repeat from step 1
- Still in mongo console, type "use your-db-name"
- You should see "switched to db your-db-name"
- Now you can put 'mongodb://localhost/node_api' in your connection settings
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 Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
var script = document.createElement('script');script.src = "https://code.jquery.com/jquery-3.1.0.min.js";document.getElementsByTagName('head')[0].appendChild(script); |
add this to end of elasticsearch.yml
script.inline: on
script.indexed: on
dpkg-reconfigure tzdata
Likes :
- I like to try / discover new things, especially if it's related to my hobbies or interest such as programming, computer / console games, astronomy
- I like to listen to people's story, make them laugh, or teach people things that's new to them
- I like to try to solve puzzles or riddles or some problems in programming. Even if i'm not good at Math and often guess wrong, i still amaze with the solutions.
Dislikes :
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
let p1 = new Promise((resolve, reject) => { | |
setTimeout(resolve, 1000, "Everything OK in Promise 1"); | |
}); | |
let p2 = new Promise((resolve, reject) => { | |
reject(new Error("Something went wrong in Promise 2!")); | |
}); | |
let p3 = new Promise((resolve, reject) => { | |
setTimeout(resolve, 2000, "Everything OK in Promise 3"); | |
}); |
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\Library\Curl; | |
class Curl { | |
private static $cookies, $proxy, $verbose, $mobile; | |
public static function setCookie($cookie_name){ | |
self::$cookies = (dirname(getcwd()) . '/storage/app/cookies/'. $cookie_name . '.txt'); |
- Check mysql mode
SELECT @@sql_mode;
- Add this snippet to
/etc/mysql/my.cnf
or if you install mysql via homebrew (MAC OS), you need to copy my.cnf withcp $(brew --prefix mysql)/support-files/my-default.cnf /usr/local/etc/my.cnf
[mysqld]
# Default : STRICT_TRANS_TABLES,ONLY_FULL_GROUP_BY,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
sql_mode = ""
- Restart mysql
OlderNewer