- 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
var script = document.createElement('script');script.src = "https://code.jquery.com/jquery-3.1.0.min.js";document.getElementsByTagName('head')[0].appendChild(script); |
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
server { | |
listen 80; | |
server_name localhost; | |
root /Users/wahyudibo/Projects/mylabs/php/nginx; | |
#error_page 404 /404.html; | |
# redirect server error pages to the static page /50x.html | |
# |
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 |
add this to end of elasticsearch.yml
script.inline: on
script.indexed: on
- 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
dpkg-reconfigure tzdata
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'); |
OlderNewer