Skip to content

Instantly share code, notes, and snippets.

View theskillwithin's full-sized avatar
😝
yay

Austin Peterson theskillwithin

😝
yay
View GitHub Profile
function addSource(){
const count = document.querySelector("table#mainSources").querySelectorAll("tr").length;
const newRow = document.querySelector("tr#tr-0").cloneNode(true);
newRow.id = "tr-"+count;
newRow.querySelectorAll("td").forEach(td => {
const name = td.getAttribute("name");
if (name == "alias" || name == "mID"){
td.querySelector("label").innerHTML = td.querySelector("label").innerHTML.replace(":", " " + count + ":");
td.querySelector("input").id = td.querySelector("input").getAttribute("id").replace("0",count);
td.querySelector("input").value = "";
@theskillwithin
theskillwithin / app.js
Last active September 8, 2019 07:34 — forked from spinningcat/app.js
{
!isAuthenticated && (
<>
<div className="wp-block-button">
<button type="button" onClick={this.handleRegister} className="wp-block-button-__link">..</button>
</div>
<div className="wp-block-button wp-block-button--disabled">
<button type="button" className="wp-block-button__link">...*</button>
</div>
</>
@theskillwithin
theskillwithin / login.jsx
Last active July 26, 2017 18:29
Prototype style
import PropTypes from 'prop-types'
class Login extends React.Component {
constructor(props) {
super(props)
this.state = {}
}
render() {
return (
<div>
@theskillwithin
theskillwithin / 0_reuse_code.js
Created February 1, 2017 18:44
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@theskillwithin
theskillwithin / if.js
Created November 15, 2016 21:18 — forked from Siilwyn/if.js
Multiple ways to handle the platform: switch vs. if...else vs. object
var getConfigDirectory = function () {
var platform = process.platform;
if (platform === 'linux') {
return process.env.XDG_CONFIG_HOME || path.join(home(), '.config')
}
else if (platform === 'darwin') {
return path.join(home(), 'Library', 'Preferences');
}
else if (platform === 'win32') {
@theskillwithin
theskillwithin / .phpstorm.meta.php
Created April 4, 2016 03:08 — forked from barryvdh/.phpstorm.meta.php
Laravel PhpStorm Meta file
<?php
namespace PHPSTORM_META {
/**
* PhpStorm Meta file, to provide autocomplete information for PhpStorm
* Generated on 2015-06-22.
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/