Giter Club home page Giter Club logo

personal-note's People

Watchers

James Cloos avatar

personal-note's Issues

Install Postgres by homebrew

Ref: exponential

  1. brew install postgres

  2. To have launchd start postgresql now and restart at login:
    brew services start postgresql
    Or, if you don't want/need a background service you can just run:
    pg_ctl -D /usr/local/var/postgres start

  3. Login to PostgreSQL for the first time.
    Press Cmd + T to open a new terminal tab.

whoami is surrounded by backticks, not single quotes.
createdb whoami
Login to PostgreSQL with your user account.

psql

  1. Optional: Install AdminPack
    AdminPack is used by PgAdmin. If you plan on using the PgAdmin UI, then installing AdminPack is a good idea.

psql postgres -c 'CREATE EXTENSION "adminpack";'

es6 convert circular object to json.

es6 convert circular object to json.
AWARE: circular reference would be null. You MUST aware that.

objToJsonString(obj) {
    let cache = []
    const jsonText = JSON.stringify(obj, function (key, value) {
      if (typeof value === 'object' && value !== null) {
        if (cache.indexOf(value) !== -1) {
          // Circular reference found, discard key
          return
        }
        // Store value in our collection
        cache.push(value)
      }
      return value
    })
    cache = null // Enable garbage collection

    return jsonText
  }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.