Skip to content

Instantly share code, notes, and snippets.

💭
Full Stack JavaScript

Wesley Rast wsrast

💭
Full Stack JavaScript
  • Atlanta, GA
Block or report user

Report or block wsrast

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@wsrast
wsrast / scraper.js
Last active May 2, 2019
Bitbucket web page scraper for repositories
View scraper.js
JSON.stringify(Array.from(document.querySelectorAll('[data-repository-id]')).map(aTag => {
const href = aTag.getAttribute('href');
let projName = href.match(/\/projects\/(.+)\/repos/)[1].toLowerCase();
let repoName = href.match(/\/repos\/(.+)\/browse/)[1];
repoName = repoName.replace(' ', '-');
const templ = `https://${location.host}/scm/${projName}/${repoName}.git`;
return {
href,
name: aTag.innerText,
clone: templ
@wsrast
wsrast / Enhanced.js
Last active Dec 18, 2018
A base HOC pattern
View Enhanced.js
import React from "react";
import { withHandlers, withState, compose } from "recompose";
const RenderComponent = ({ handleClick, stateValue, newValue }) => {
return (
<button onClick={handleClick}>
RenderComponent ({stateValue.value} clicks!)
</button>
);
};
@wsrast
wsrast / index.js
Created Nov 16, 2018
Simple React functional component (super meaty)
View index.js
import React from 'react';
import PropTypes from 'prop-types';
const Functional3 = props => {
return (
<div>
Hello from Functional3 and {props.name}!
</div>
)
};
@wsrast
wsrast / index.js
Last active Nov 16, 2018
Simple React functional component (meatier)
View index.js
import React from 'react';
const Functional2 = props => {
return (
<div>
Hello from Functional2 and {props.name}!
<br/>
this: {this}
</div>
)
@wsrast
wsrast / index.js
Created Nov 16, 2018
Simple React functional component
View index.js
const Functional = props => <div>This is a Functional component!</div>;
@wsrast
wsrast / index.html
Created Jul 24, 2017
JS Bin Adding scripts to an interior iframe through src attribute and/or DOM access // source http://jsbin.com/vijupoy
View index.html
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Adding scripts
to an interior iframe through
src attribute and/or DOM access">
<meta charset="utf-8">
<meta name="viewport"
content="width=device-width">
<title>JS Bin</title>
@wsrast
wsrast / data.json
Last active May 9, 2017
Overwatch Pharmercy Calculator
View data.json
{
"shooters": {
"Bastion (recon)": {
"dmgFalloffStart": 26,
"dmgFalloffEnd": 50,
"magSize": 25,
"maxShotDmg": 20,
"minShotDmg": 6,
"reloadTime": 2.0,
"shotsPerSec": 8
You can’t perform that action at this time.