Skip to content

Instantly share code, notes, and snippets.

View vdloc's full-sized avatar
:accessibility:
Good things take time

Vũ Đức Lộc vdloc

:accessibility:
Good things take time
View GitHub Profile
@vdloc
vdloc / package.json
Created May 16, 2018 09:39 — forked from escapedcat/package.json
npm scripts including node-sass and autoprefixer
{
"name": "foo",
"version": "1.0.0",
"description": "foo project",
"main": "index.js",
"scripts": {
"start": "npm run serve | npm run watch-css",
"serve": "./node_modules/.bin/http-server -p 8080",
"build-css": "./node_modules/node-sass/bin/node-sass app/sass/style.scss -o app/css/ && ./node_modules/postcss-cli/bin/postcss --use autoprefixer app/css/style.css -d app/css/",
"watch-css": "nodemon -e scss -x 'npm run build-css'"
@vdloc
vdloc / meta-tags.md
Created August 20, 2018 05:35 — forked from lancejpollard/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
@vdloc
vdloc / README.md
Created September 18, 2018 06:50 — forked from joyrexus/README.md
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@vdloc
vdloc / input.scss
Created May 14, 2019 07:04 — forked from lukasborawski/input.scss
Perfect media-queries screen breakpoints SASS @mixin. Tested on Apple Devices: iPhone4, iPhone5, iPad3, MacBook Pro, iPad Mini. http://sassmeister.com/gist/8529371
$media-queries: true;
@mixin bp($point) {
@if ($media-queries) {
$bp-large-screen: 1824px;
$bp-bigscreen: 1824px;
$bp-ipad-max: 1024px;
$bp-ipad-min: 768px;
$bp-iphone5-max: 568px;
$bp-iphone-max: 480px;
@vdloc
vdloc / input.scss
Created May 14, 2019 07:04 — forked from lukasborawski/input.scss
Perfect media-queries screen breakpoints SASS @mixin. Tested on Apple Devices: iPhone4, iPhone5, iPad3, MacBook Pro, iPad Mini. http://sassmeister.com/gist/8529371
$media-queries: true;
@mixin bp($point) {
@if ($media-queries) {
$bp-large-screen: 1824px;
$bp-bigscreen: 1824px;
$bp-ipad-max: 1024px;
$bp-ipad-min: 768px;
$bp-iphone5-max: 568px;
$bp-iphone-max: 480px;
@vdloc
vdloc / japanese-full-to-half-method.js
Created September 22, 2020 02:30 — forked from heeju/japanese-full-to-half-method.js
Convert full-width Japanese character to half-width ascii character
String.prototype.toHalfWidth = function() {
return this.replace(/[!-~]/g, function(r){
return String.fromCharCode(r.charCodeAt(0) - 0xFEE0);
});
};
@vdloc
vdloc / japanese-full-to-half-method.js
Created September 22, 2020 02:30 — forked from heeju/japanese-full-to-half-method.js
Convert full-width Japanese character to half-width ascii character
String.prototype.toHalfWidth = function() {
return this.replace(/[!-~]/g, function(r){
return String.fromCharCode(r.charCodeAt(0) - 0xFEE0);
});
};
@vdloc
vdloc / JapaneseRegex.js
Created September 24, 2020 02:45 — forked from ryanmcgrath/JapaneseRegex.js
Regex to test for presence of Japanese characters
// REFERENCE UNICODE TABLES:
// http://www.rikai.com/library/kanjitables/kanji_codes.unicode.shtml
// http://www.tamasoft.co.jp/en/general-info/unicode.html
//
// TEST EDITOR:
// http://www.gethifi.com/tools/regex
//
// UNICODE RANGE : DESCRIPTION
//
// 3000-303F : punctuation
@vdloc
vdloc / regex-japanese.txt
Created October 22, 2020 11:46 — forked from terrancesnyder/regex-japanese.txt
Regex for Japanese
Regex for matching ALL Japanese common & uncommon Kanji (4e00 – 9fcf) ~ The Big Kahuna!
([一-龯])
Regex for matching Hirgana or Katakana
([ぁ-んァ-ン])
Regex for matching Non-Hirgana or Non-Katakana
([^ぁ-んァ-ン])
Regex for matching Hirgana or Katakana or basic punctuation (、。’)
@vdloc
vdloc / react-rendering.md
Created November 14, 2020 15:53 — forked from tuhuynh27/react-rendering.md
A (Mostly) Complete Guide to React Rendering Behavior

Translated from https://blog.isquaredsoftware.com/2020/05/blogged-answers-a-mostly-complete-guide-to-react-rendering-behavior/, author: Mark Erikson (from Redux team)

A (Mostly) Complete Guide to React Rendering Behavior

Bài viết cung cấp chi tiết về cách mà React render hoạt động, và việc sử dụng Context và Redux ảnh hưởng thế nào tới quá trình render của React.

"Render" là gì

Rendering is the process of React asking your components to describe what they want their section of the UI to look like, now, based on the current combination of props and state.