Skip to content

Instantly share code, notes, and snippets.

@dhminh1024
dhminh1024 / Setup MongoDB on localhost as Replica Set
Created May 9, 2021 01:05 — forked from davisford/Setup MongoDB on localhost as Replica Set
Setup MongoDB replica set on local host with only a single primary
Add the `replication` section to the mongod.conf file:
```
$cat /usr/local/etc/mongod.conf
systemLog:
destination: file
path: /usr/local/var/log/mongodb/mongo.log
logAppend: true
storage:
engine: mmapv1
@dhminh1024
dhminh1024 / python_code.py
Last active March 17, 2021 03:21
Testing python code on Colab
arr = [1, 2, 3]
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""This module's docstring summary line.
This is a multi-line docstring. Paragraphs are separated with blank lines.
Lines conform to 79-column limit.
Module and packages names should be short, lower_case_with_underscores.
Notice that this in not PEP8-cheatsheet.py
@dhminh1024
dhminh1024 / app.js
Created September 16, 2018 09:35 — forked from lrvick/app.js
AngularJS credit card form with validation
// MIT: http://opensource.org/licenses/MIT
angular.module('app', []);
angular.module('app').controller
( 'MainCtrl'
, function($scope,$locale) {
$scope.currentYear = new Date().getFullYear()
$scope.currentMonth = new Date().getMonth() + 1
$scope.months = $locale.DATETIME_FORMATS.MONTH
@dhminh1024
dhminh1024 / 0_reuse_code.js
Created December 9, 2016 06:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console