This guide is based on the very informative discussion in this article: Using node_sqlite3 with Electron
Install sqlite3
npm install sqlite3 --save
This guide is based on the very informative discussion in this article: Using node_sqlite3 with Electron
Install sqlite3
npm install sqlite3 --save
/* HOC fundamentally is just a function that accepts a Component and returns a Component: | |
(component) => {return componentOnSteroids; } or just component => componentOnSteroids; | |
Let's assume we want to wrap our components in another component that is used for debugging purposes, | |
it just wraps them in a DIV with "debug class on it". | |
Below ComponentToDebug is a React component. | |
*/ | |
//HOC using Class | |
//it's a function that accepts ComponentToDebug and implicitly returns a Class | |
let DebugComponent = ComponentToDebug => class extends Component { |
<IfModule LiteSpeed> | |
RewriteEngine on | |
RewriteCond %{REQUEST_METHOD} ^(HEAD|GET)$ | |
RewriteCond %{REQUEST_URI} !^/(wp-admin|wp-login.php|wp-cron.php|xmlrpc\.php) | |
RewriteCond %{HTTP_COOKIE} !(comment_author_|wordpressuser_|wp-postpass_|wordpress_logged_in_|wp_woocommerce_session_|wordpress_test_cookie) | |
RewriteRule .* - [E=Cache-Control:max-age=120] | |
</IfModule> |
[ | |
"Afghan", | |
"Albanian", | |
"Algerian", | |
"American", | |
"Andorran", | |
"Angolan", | |
"Antiguans", | |
"Argentinean", | |
"Armenian", |
$.fn.isVisible = function() { | |
// Am I visible? | |
// Height and Width are not explicitly necessary in visibility detection, the bottom, right, top and left are the | |
// essential checks. If an image is 0x0, it is technically not visible, so it should not be marked as such. | |
// That is why either width or height have to be > 0. | |
var rect = this[0].getBoundingClientRect(); | |
return ( | |
(rect.height > 0 || rect.width > 0) && | |
rect.bottom > 0 && | |
rect.right > 0 && |
If you don't have homebrew installed - get homebrew here
Then run: brew install elasticsearch
Update the elasticsearch configuration file in /usr/local/etc/elasticsearch/elasticsearch.yml
.
DROP TABLE IF EXISTS calendar; | |
CREATE TABLE calendar ( | |
id INTEGER PRIMARY KEY, -- year*10000+month*100+day | |
date DATE NOT NULL, | |
year INTEGER NOT NULL, | |
month INTEGER UNSIGNED NOT NULL, -- 1 to 12 | |
day INTEGER UNSIGNED NOT NULL, -- 1 to 31 | |
quarter INTEGER UNSIGNED NOT NULL, -- 1 to 4 | |
week INTEGER UNSIGNED NOT NULL, -- 1 to 52/53 | |
dayofweek INTEGER UNSIGNED NOT NULL, -- 1 to 7 |
copy(JSON.stringify(YOUR_JSON_ARRAY_OR_OBJECT)); |
var uniqueArray = function(arrArg) { | |
return arrArg.filter(function(elem, pos,arr) { | |
return arr.indexOf(elem) == pos; | |
}); | |
}; | |
var uniqEs6 = (arrArg) => { | |
return arrArg.filter((elem, pos, arr) => { | |
return arr.indexOf(elem) == pos; | |
}); |