Skip to content

Instantly share code, notes, and snippets.

View thaycacac's full-sized avatar
🎨
Artist

Thaycacac thaycacac

🎨
Artist
View GitHub Profile
@thaycacac
thaycacac / keybase.md
Created September 12, 2019 02:15
keybase.md

thaycacac

Keybase proof

I hereby claim:

  • I am thaycacac on github.
  • I am thaycacac (https://keybase.io/thaycacac) on keybase.
  • I have a public key ASDeGPdl9vdaj5m2wykedNEpLjWyizbW5xpJk7VCotpBRAo

To claim this, I am signing this object:

@thaycacac
thaycacac / nodecss.md
Last active August 11, 2019 10:36
Ghi chú CSS

Xử lý text-overflow

Với block-element

element {
  white-space: nowrap; 
  overflow: hidden;
  text-overflow: ellipsis; /* text-overflow: clip; */
}
@thaycacac
thaycacac / eslint-to-nuxtjs.md
Last active June 21, 2019 01:30
Config project nuxtjs
yarn add -D @nuxtjs/eslint-config babel-eslint eslint eslint-config-standard eslint-loader eslint-plugin-babel eslint-plugin-import eslint-plugin-node eslint-plugin-prettier eslint-plugin-promise eslint-plugin-standard eslint-plugin-vue prettier

File .eslintrc.js

module.exports = {
  root: true,
 env: {

Example useRef

import React, { forwardRef, useRef, useImperativeHandle } from 'react';

// We need to wrap component in `forwardRef` in order to gain
// access to the ref object that is assigned using the `ref` prop.
// This ref is passed as the second parameter to the function component.
const Child = forwardRef((props, ref) => {
`javascript
import React, { forwardRef, useRef, useImperativeHandle } from 'react';
// We need to wrap component in `forwardRef` in order to gain
// access to the ref object that is assigned using the `ref` prop.
// This ref is passed as the second parameter to the function component.
const Child = forwardRef((props, ref) => {
// The component instance will be extended
// with whatever you return from the callback passed
@thaycacac
thaycacac / fix-eforea.md
Last active January 31, 2019 10:05
fix lỗi khi nào trang xem menu

Mô tả:

  • Khi từ một trang bất kỳ sang trang mấy trang có cuốn sách (tỷ dụ như Ba son, Tân Cảng) sẽ báo lỗi window.$ is not a function

img

Nguyên nhân: Do phần external resources của component nó chạy sau lifecycle nuxtjs.

Giải quyết:

  • Tạo plugin truyền vào link script và page hiện tại để add thêm thẻ script vào head của trang hiện tại. sau đấy thì mới thực hiện công việc (promise)
@thaycacac
thaycacac / note-at.md
Last active January 31, 2019 10:07
Note AT

Render HTML to React Native

import HTMLView from 'react-native-htmlview'

<HTMLView value={value.excerpt.rendered} renderNode={this.renderNode} />

renderNode(node) {
  if (node.name === 'img') {
    const a = node.attribs
@thaycacac
thaycacac / README-Template.md
Created January 12, 2019 20:55 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@thaycacac
thaycacac / regex.md
Created January 9, 2019 03:06
Note Regex

Độ mạnh của mật khẩu

^(?=.*[A-Z].*[A-Z])(?=.*[!@#$&*])(?=.*[0-9].*[0-9])(?=.*[a-z].*[a-z].*[a-z]).{8}$

Xác thực email

/[A-Z0-9._%+-]+@[A-Z0-9-]+.+.[A-Z]{2,4}/igm
@thaycacac
thaycacac / prj321.md
Created January 7, 2019 18:46
Note Java Web

This is document prepare for practice example course Web-Based Java Applications. DBContext

package com.context;
import java.sql.Connection;
import java.sql.DriverManager;

public class DBContext {
    /*USE BELOW METHOD FOR YOUR DATABASE CONNECTION FOR BOTH SINGLE AND MULTILPE SQL SERVER INSTANCE(s)*/