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 default function importModule(moduleName) { | |
| return new Promise(resolve => { | |
| require.ensure([moduleName], () => { | |
| resolve(require(moduleName)); | |
| }); | |
| }); | |
| } |
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
| VBoxManage modifyvm "OSX" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff | |
| VBoxManage setextradata "OSX" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3" | |
| VBoxManage setextradata "OSX" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0" | |
| VBoxManage setextradata "OSX" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple" | |
| VBoxManage setextradata "OSX" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" | |
| VBoxManage setextradata "OSX" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1 |
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
| var string = `copy your php here` | |
| console.log( | |
| string | |
| .replace(/class=/g, 'className=') | |
| .replace(/<\?php/g, '{') | |
| .replace(/\?>/g, '}') | |
| .replace(/echo/g, '') | |
| .replace(/{ endif; }/g, '}') |
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
| let persist = false; | |
| let ref = null; | |
| export function setStateContainer(componentInstance, isPersist) { | |
| ref = componentInstance; | |
| persist = isPersist; | |
| } | |
| export function isPersist() { | |
| return persist; |
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 sanitizeQuery from 'helper/sanitizeQuery'; | |
| import serialize from 'helper/serialize'; | |
| const getSuccessActionType = KEY => | |
| type => [ KEY, type.toUpperCase(), 'SUCCESS' ].join('_'); | |
| const initialCollectionState = { | |
| items: {}, | |
| list: {}, | |
| infiniteList: {}, |
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
| #taken from https://coderwall.com/p/guqrca/remove-all-node_module-folders-recursively | |
| find . -name "node_modules" -exec rm -rf '{}' + |
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
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
| for f in $(find $dir -name '*.php'); | |
| do | |
| (./wp-phptidy.php replace $f) | |
| done | |
| for f in $(find $dir -name '*.phptidybak~'); | |
| do | |
| (rm -f $f) | |
| done |
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 elt(name, attributes) { | |
| var node = document.createElement(name); | |
| if (attributes) { | |
| for (var attr in attributes) | |
| if (attributes.hasOwnProperty(attr)) | |
| node.setAttribute(attr, attributes[attr]); | |
| } | |
| for (var i = 2; i < arguments.length; i++) { | |
| var child = arguments[i]; | |
| if (typeof child == "string") |
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 React from "react"; | |
| let store; | |
| export default function createStore( | |
| reducer, | |
| initialState = {}, | |
| ...middlewares | |
| ) { | |
| const subscribers = []; | |
| let newState = initialState; |