Skip to content

Instantly share code, notes, and snippets.

View JonathanZWhite's full-sized avatar
🦁

Jonathan White JonathanZWhite

🦁
View GitHub Profile
{
"background_color": "#ffffff",
"categories": [
"social",
"news",
"magazines"
],
"description": "Get breaking news, politics, trending music, world events, sports scores, and the latest global news stories as they unfold - all with less data.",
"display": "standalone",
"icons": [
/**
* Given the offset and length of characters to replace, as well
* as the words to replace them with, write a function that produces
* the new sentance.
*/
const case1 = 'The adjective animal sat on the object';
const case1Entities = [
{ offset: 4, length: 9, value: 'fat' },
{ offset: 14, length: 6, value: 'cat' },
function dots(width, height, density) {
for (let i = 0; i < density; i += 1) {
createDot(
Math.floor(Math.random() * width),
Math.floor(Math.random() * height),
);
}
}
function createDot(x, y) {
{
"ok": true,
"assignments": {
"handlebars_from_smarty_perf": {
"experiment_id": "46172931351",
"type": "user",
"group": "",
"trigger": "finished",
"log_exposures": false,
"exposure_id": "3848131076"
function Parent() {
return (
<Heading tag="h2">Hello World</Heading>
);
}
import React, { PropTypes } from 'react';
import { StyleSheet, css } from 'aphrodite/no-important';
import { spacing } from '../../styles/base/spacing';
function Card(props) {
return (
<div className={css(styles.card)}>
{props.children}
</div>
);
import React, { PropTypes } from 'react';
import { spacing } from '../../base/spacing';
function getSpacingSize(size) {
return `space${size}`;
}
function Spacing(props) {
return (
<div style={{ marginBottom: spacing[getSpacingSize(props.size)] }}>
import { spacing } from '../styles/base/spacing';
...
const styles = StyleSheet.create({
button: {
marginBottom: spacing.space4, // adding margin using spacing constant
...
},
});
const spacingFactor = 8;
export const spacing = {
space0: `${computeGoldenRatio(spacingFactor, 0)}px`, // 8
space1: `${computeGoldenRatio(spacingFactor, 1)}px`, // 13
space2: `${computeGoldenRatio(spacingFactor, 2)}px`, // 21
space3: `${computeGoldenRatio(spacingFactor, 3)}px`, // 34
space4: `${computeGoldenRatio(spacingFactor, 4)}px`, // 55
space5: `${computeGoldenRatio(spacingFactor, 5)}px`, // 89
};
const spacingFactor = 8;
export const spacing = {
space0: `${spacingFactor / 2}px`, // 4
space1: `${spacingFactor}px`, // 8
space2: `${spacingFactor * 2}px`, // 16
space3: `${spacingFactor * 3}px`, // 24
space4: `${spacingFactor * 4}px`, // 32
space5: `${spacingFactor * 5}px`, // 40
space6: `${spacingFactor * 6}px`, // 48