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
// .eslintrc.js | |
module.exports = { | |
parser: '@typescript-eslint/parser', | |
extends: [ | |
'plugin:@typescript-eslint/recommended', | |
'prettier/@typescript-eslint', | |
'react-app', | |
'plugin:prettier/recommended', | |
], |
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 getScrollParent(node) { | |
const isElement = node instanceof HTMLElement; | |
const overflowY = isElement && window.getComputedStyle(node).overflowY; | |
const isScrollable = overflowY !== 'visible' && overflowY !== 'hidden'; | |
if (!node) { | |
return null; | |
} else if (isScrollable && node.scrollHeight >= node.clientHeight) { | |
return node; | |
} |
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
import axios from "axios"; | |
const singleton = Symbol(); | |
const singletonEnforcer = Symbol(); | |
function readCookie(name) { | |
const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); | |
return (match ? decodeURIComponent(match[3]) : null); | |
} |
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
export const fulfilled = (actionType) => `${actionType}_FULFILLED` | |
export const rejected = (actionType) => `${actionType}_REJECTED` | |
export const pending = (actionType) => `${actionType}_PENDING` | |
export const resetAction = (actionType) => `${actionType}_RESET` | |
/** | |
* Create a dictionary with all the phases of an async action | |
* @param {string} baseAction | |
*/ | |
const createActionTypes = (baseAction) => ({ |
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
// created by : Narate Ketram | |
package main | |
import ( | |
"fmt" | |
"github.com/ant0ine/go-json-rest" | |
"labix.org/v2/mgo" | |
"labix.org/v2/mgo/bson" | |
"net/http" |
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
/* | |
I have an existing node.js API server that runs on top of restify. I wanted to add http-proxy to forward | |
some calls to another API server. From the http-proxy examples out there, it seemed simply enough: | |
*/ | |
var httpProxy = require('http-proxy'); | |
var proxy = new httpProxy.RoutingProxy(); | |
var restify = require('restify'); | |
var server = restify.createServer(); |
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
<?php | |
/** | |
* Hide editor on specific pages. | |
* | |
*/ | |
add_action( 'admin_init', 'hide_editor' ); | |
function hide_editor() { | |
// Get the Post ID. |