View useModal.jsx
This file contains 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' | |
import ReactDOM from 'react-dom' | |
import { Modal } from 'antd' | |
const useModal = (Component, props) => { | |
const [open, setOpen] = React.useState(false) | |
const [loading, setLoading] = React.useState(false) | |
const onOk = props.onOk || (() => {}) | |
const handleOk = () => { |
View EditableReactiveDiv.jsx
This file contains 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' | |
import PropTypes from 'prop-types' | |
const EditableReactiveDiv = (props) => { | |
const { value: propsValue, onChange: propsOnChange, ...rest } = props | |
const [currentValue, setCurrentValue] = React.useState(propsValue) | |
const divRef = React.useRef(null) | |
React.useEffect(() => { | |
if (document.activeElement !== divRef.current) { |
View awscert
This file contains 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
#!/usr/bin/env python | |
import argparse, os, readline | |
# Check if AWS CLI is installed | |
if os.popen("command -v aws").read() == '': | |
print('AWS Command Line Interface is not installed.') | |
exit() | |
# Parse Arguments |
View Check-If-All-Checked.js
This file contains 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
$('#inserting').submit(function(){ | |
var confirms = ["true"]; | |
// Class/Function to check if all values are the same. - http://stackoverflow.com/a/14832662 | |
Array.prototype.allValuesSame = function() { | |
for(var i = 1; i < this.length; i++) | |
{ | |
if(this[i] !== this[0]) |