This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://mherman.org/blog/dockerizing-a-react-app/ | |
https://scotch.io/tutorials/react-docker-with-security-in-10-minutes | |
Node best practice: https://github.com/goldbergyoni/nodebestpractices |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This react hook tracks page visibility using browser page visibility api. | |
* Reference: https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API | |
* | |
* Use: const pageVisibilityStatus = usePageVisibility(); | |
* Return type: boolean | |
*/ | |
import { useState, useEffect } from 'react'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Swipe hook gives functionality to detect user swipe event on give container. | |
* Dependency: hammerjs (npm install hammerjs --save) | |
* | |
* e.g | |
* Component.js | |
* const swipeContainerRef = useRef(); | |
* useSwipeHook(swipeContainerRef, leftSwipeCallback, rightSwipeCallback) | |
* <div ref={swipeContainerRef}>Swipe hook will catch events for this container</div> | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function flattenObj(obj, preKey) { | |
const entries = Object.entries(obj); | |
return entries.reduce((acc, curr) => { | |
let [key, value] = curr; | |
return typeof value !== 'object' | |
? Object.assign(acc, { [preKey ? `${preKey}.${key}` : key] : value }) | |
: Object.assign(acc, flattenObj(value, preKey ? `${preKey}.${key}` : key)); | |
}, {}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Node() { | |
this.keys = new Map(); | |
this.end = null; | |
this.setEnd = function() { | |
this.end = true; | |
} | |
this.isEnd = function() { | |
return this.end; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Cron monitor tool: https://github.com/zricethezav/gronit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select id, | |
name, | |
parent_id | |
from (select * from user_categories | |
order by parent_id, id) products_sorted, | |
(select @pv := '104') initialisation | |
where find_in_set(parent_id, @pv) | |
and length(@pv := concat(@pv, ',', id)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css"> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> | |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script> | |
<body> | |
<script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rich text editor: https://www.npmjs.com/package/@syncfusion/ej2-angular-richtexteditor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://github.com/rafaelquintanilha/experiments/tree/master/sortable-target | |
http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/nested | |
https://www.if-not-true-then-false.com/2010/install-mysql-on-fedora-centos-red-hat-rhel/ | |
https://serversforhackers.com/c/battling-selinux-cast | |
https://linuxize.com/post/how-to-use-linux-screen/ | |
https://plusbryan.com/mysql-replication-without-downtime | |
how to mount centos: https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-centos-6 |
NewerOlder