Skip to content

Instantly share code, notes, and snippets.

View Polyrhythm's full-sized avatar
🎯
Focusing

Polyrhythm

🎯
Focusing
View GitHub Profile
function render() {
container.innerHTML = data.map(function(val) {
return '<li>' + val + '</li>';
}).join('');
}
function() {
var val = input.value;
if (val) {
data.push(val);
input.value = '';
render();
}
}
var items = [{ sold: true}, {sold: false}, {sold: true}];
for (var i = 0; i < items.length; i++) {
if (items[i].sold) {
console.log('you done bought me');
}
}
function Car(make, model) {
this.make = make;
this.model = model;
var miles = 0;
this.increasMiles = function() {
miles++;
};
}
var CLIENT_ID = 'nope';
class Matcher extends React.Component {
constructor(props: { imageCount: number }) {
super(props);
this.state = { images: [] };
this.fetchRandomImages(this.props.imageCount);
}
unbind C-b
set -g prefix C-w
# pane switching
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# pane creation
import React from 'react';
import { Link } from 'react-router';
import copy from 'shared/constants/copy';
import PostComments from 'shared/components/PostComments';
import PostCommentControls from 'shared/components/PostCommentControls';
import FluxComponent from 'flummox/component';
export default class PostComment extends React.Component {
constructor(props) {
super(props);
import React from 'react';
import PostComment from 'shared/components/PostComment';
import copy from 'shared/constants/copy';
import randomColor from 'shared/util/random_color';
import FluxComponent from 'flummox/component';
import Ad from 'shared/components/Ad';
export default class PostComments extends React.Component {
shouldComponentUpdate(nextProps, nextState) {
if (nextProps.comments === this.props.comments) {
@Polyrhythm
Polyrhythm / component.jsx
Last active October 15, 2015 23:21
Isomorphic component
export default class IsomorphicComponent extends React.Component {
// this only executes on the browser
componentDidMount() {
const wrapper = React.findDOMNode(this.refs.app);
wrapper.style.left = wrapper.getBoundClientRect().left + 'px';
}
// this executes on the server and the browser
render() {
return (
EBGUIP = window.EBGUIP || {};
EBGUIP.SizmekDI = function(options, extra) {
this.options = options || {};
var t = [];
this.languageKey(t);
this.languagesKey(t);
this.hasLiedLanguagesKey(t);
this.colorDepthKey(t);
this.screenResolutionKey(t);
this.availableScreenResolutionKey(t);