Skip to content

Instantly share code, notes, and snippets.

View joshuarule's full-sized avatar

Joshua Rule Dobson joshuarule

  • Funko
  • Tacoma, Wa
  • 14:33 (UTC -08:00)
View GitHub Profile
async getSkus(starting_after, result = []) {
const skus = await stripe.skus.list({starting_after: starting_after});
result.push(skus)
if(skus.length === 100) {
return getSkus(skus[skus.length], result);
}
return result
}
let skus = getSkus();
import React, { Component, Fragment } from 'react';
import ReactDOM from 'react-dom'
const modalRoot = document.getElementById('modal-root')
export default class Modal extends Component {
render() {
const {isVisible} = this.props
return ReactDOM.createPortal(
<Fragment>
const gallery = {
type: {
"default": {
maxSlides: 10, // static
galleryTitle: string, // max 20 char
autoPlay: boolean,
slideDuration: number in seconds min 3 - 10,
slides: [
{
slideTitle: string, // optional
@joshuarule
joshuarule / _.md
Created May 11, 2016 21:00
bar chart
@joshuarule
joshuarule / _.md
Created May 11, 2016 20:29
reddit base
@joshuarule
joshuarule / edits.css
Created January 29, 2016 22:12
edits for app
body,
html {
height: 100%;
}
body {
display: flex;
flex-direction: column;
}
facebookHelper.prototype.getMedia = function (post) {
console.log(post.type);
console.log(post.caption);
var imageUrl = post.type == "link" ? (post.picture ? this.cleanImageUrl(post.picture.match(/(url=)(.+)$/)[2]) : null) : (this.fbFeedUrl + "{objectId}/picture?type=normal&redirect=true&access_token={token}"
.replace("{objectId}", post.object_id)
.replace("{token}", this.accessToken));
if (post.type == "link" || post.type == "photo" || post.type == "event") {
return imageUrl ? this.imgTemplate.replace(/{url}/g, imageUrl).replace(/{description}/g, post.description) : ""
+ (post.type == "link" ?
this.linkTemplate.replace(/{linkText}/g, post.name ? post.name : post.story).replace(/{href}/g, post.link) + (post.description ? this.descriptionTemplate.replace(/{description}/g, post.description) : '')
  1. Between the <body> tags, before <div data-montage-id="montageVersion"></div>, add the following markup:

    <h1>Temperature Converter</h1>
    <div data-montage-id="tempConverter"></div>

The data-montage-id custom data attribute is used to identify elements in the markup whose behavior you want to control. The objects that control these elements are located within the script block in the head area of the HTML document.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div id="edit" contenteditable="true">test</div>
<button onclick="toogleSelectionText()">select/deselect</button>
<script id="jsbin-javascript">
@joshuarule
joshuarule / index.html
Created December 5, 2014 01:22
Select contentEditable text: http://jsbin.com/wivajetove
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div id="edit" contenteditable="true">test</div>
<button onclick="toogleSelectionText()">select/deselect</button>
<script id="jsbin-javascript">