Refs:
// Init new db
// If the database file does not exist, it is created
// This happens synchronously, which means you can start executing queries right away
const Database = require('better-sqlite3');
// @link: https://github.com/bootstrap-vue/bootstrap-vue/blob/dev/src/utils/array.js | |
const from = (...args) => Array.from(...args) | |
const isArray = val => Array.isArray(val) | |
const arrayIncludes = (array, value) => array.indexOf(value) !== -1 | |
const concat = (...args) => Array.prototype.concat.apply([], args) | |
export const createAndFillArray = (size, value) => Array(size).fill(value) |
Refs:
// Init new db
// If the database file does not exist, it is created
// This happens synchronously, which means you can start executing queries right away
const Database = require('better-sqlite3');
Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources (e.g. fonts) on a web page to be requested from another domain outside the domain from which the first resource was served. This is set on the server-side and there is nothing you can do from the client-side to change that setting, that is up to the server/API. There are some ways to get around it tho.
Sources : MDN - HTTP Access Control | Wiki - CORS
CORS is set server-side by supplying each request with additional headers which allow requests to be requested outside of the own domain, for example to your localhost
. This is primarily set by the header:
Access-Control-Allow-Origin
# Node-WebKit CheatSheet | |
# Download: https://github.com/rogerwang/node-webkit#downloads | |
# Old Versions: https://github.com/rogerwang/node-webkit/wiki/Downloads-of-old-versions | |
# Wiki: https://github.com/rogerwang/node-webkit/wiki | |
# How: https://github.com/rogerwang/node-webkit/wiki/How-node.js-is-integrated-with-chromium | |
# 1. Run your application. | |
# https://github.com/rogerwang/node-webkit/wiki/How-to-run-apps |
// 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 |
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 (、。’) |
// determine how many days are in a given month | |
// http://stackoverflow.com/questions/315760/what-is-the-best-way-to-determine-the-number-of-days-in-a-month-with-javascript | |
function daysInMonth( m, y ) { | |
return m === 2 ? y & 3 || !( y % 25 ) && y & 15 ? 28 : 29 : 30 + ( m+ ( m >> 3 ) & 1 ); | |
} | |
// determine the day number since beginning of the year | |
// http://stackoverflow.com/questions/8619879/javascript-calculate-the-day-of-the-year-1-366/27790471#27790471 | |
function dayNo( y, m, d ){ | |
return --m * 31 - ( m > 1 ? ( 1054267675 >> m * 3 -6 & 7 ) - ( y & 3 || !( y % 25 ) && y & 15 ? 0 : 1 ) : 0 ) + d; |
Just migrated it from Codepen.io to markdown. Credit goes to David Conner.
Working with DOM | Working with JS | Working With Functions |
---|---|---|
Accessing Dom Elements | Add/Remove Array Item | Add Default Arguments to Function |
Grab Children/Parent Node(s) | Add/Remove Object Properties | Throttle/Debounce Functions |
Create DOM Elements | Conditionals |