Giter Site home page Giter Site logo

general_memo's Introduction

Git memo

Set always commit for merge
$ git config --global --add merge.ff false
Remove all untracked files and folders
$ git clean -fd
Change previous commit history
$ git rebase -i --root
$ git commit --amend
$ git rebase --continue
Check git log graph
$ git log --graph --oneline

AWS

RDS - PostgreSQL

  • create database with free tier option
  • #connectivity: create new VPC (or set proper VPC setting for rds)
  • #connectivity - additional connectivity configuration - Publicly accessible: yes
  • create button

linux commands

find program location
$ locate -b '\atom'

Node memo

update method
  • consider to use lodash npm _.merge
  • use put or patch

API memo

json placeholder website

http://jsonplaceholder.typicode.com/

axios

Promise based HTTP client for the browser and node.js

async-await

async means a function returns a resolved Promise. await means wait until the Promise settles and return its result.

Typescript

Type

easy way to refer to the different properties + functions that a value has

Rails memo

Rails new default option set
  • postgresql default database / not using minitest / skip coffee auto generating
# ~/.railsrc
--database=postgresql
-T
--skip-coffee
After rails new with postgresql
$ rails db:create
$ rails db:migrate
After setting back-end environment, check working

$ curl -H "Content-Type: application/json" -X POST -d '{"username":"1st_user","password":"foobar"}' http://localhost:3001/login

$ curl -H "Content-Type: application/json" -X POST -d '{"username":"2nd_user","password":"foobar"}' http://localhost:3001/login

Push heroku
$ heroku git:remote -a [name of heroku app]
$ heroku run rails db:migrate
$ heroku run rails db:seed
Rubocop code style check
  • Choose the option one of this below
$ rubocop -x
$ rubocop --auto-correct
  • Make exception
$ rubocop --auto-gen-config  
Postgresql restart
$ sudo service postgresql restart
Server restart
$ ps -aef | grep rails    
$ kill -9 [pID]   
Rails console save error
> p.errors.messages
Heroku rails app image not showing
  • config > environments > production.rb
config.assets.compile = true
config.assets.digest = true
heroku server reset
$ heroku pg:reset DATABASE
Haml
Nested form
  • with stimulus
Active Storage
Rails 6 connect bootstrap

General memo

generate random image

https://source.unsplash.com/featured?galaxy

E-R diagram tool

https://app.lucidchart.com/

Get some dummy texts
https://hipsum.co

CSS memo

sass watch
  • basic
sass --watch scss/style.ss:dist/css/style.css
  • compressed
sass --watch scss/style.ss:dist/css/style.min.css --style compressed
gradient picker
css 3 generator
float with clearfix
<div class="clearfix">
  <div class="float-left">
  </div>
</div>

.clearfix:after {
   content: ".";
   visibility: hidden;
   display: block;
   height: 0;
   clear: both;
}

general_memo's People

Watchers

 avatar

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.