Skip to content

Instantly share code, notes, and snippets.

View yarnball's full-sized avatar

YarnBall yarnball

View GitHub Profile
{ "results": [
{
"category": "TEST",
"createdAt": "2015-04-01T12:32:47.037Z",
"currency": "AUD",
"designer": "Ray-Ban",
"gender": "women",
"index": 2,
"itemDescription": "Wayfarer glasses by Ray-Ban Angular frames with pin detailing to corners Moulded nose pads for added comfort Clear non-prescription lenses Branded arms with curved temple tips for a secure fit The lenses can be replaced with a prescription lens ABOUT RAY-BAN First produced for the U.S. Air Force, Ray-Ban has been making iconic sunglasses since 1937. With a rich pop culture history, Ray-Ban has gained global recognition, a cult fan-base and A-list credentials. Opt for classic frames in Aviator, W",
"link": "http://click.linksynergy.com/link?id=dnw*50nuNL8\u0026offerid=287549.2564686\u0026type=15\u0026murl=http%3A%2F%2Fwww.asos.com%2Fau%2FRay-Ban%2FRay-Ban-New-Wayfarer-Glasses%2FProd%2Fpgeproduct.aspx%3Fiid%3D3938725%26istCompanyId%3Df448b47d-6b90-4b9b-a52d-eb6058c99b1c%26istItem
import React, {Component} from 'react';
import firebase from '../../utils/firebase';
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import {fetchUser, updateUser} from '../../actions/firebase_actions';
import Loading from '../helpers/loading';
import ChangePassword from './change_password';
import { DATA_API, POST_API } from './Api';
import {Link} from 'react-router';
import { SplitButton, DropdownButton, MenuItem, Badge, Button, ButtonToolbar, FieldGroup, ButtonGroup, Tab, Tabs, Panel, ListGroup, ListGroupItem } from 'react-bootstrap';
import React, {Component} from 'react';
import firebase from '../../utils/firebase';
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import {fetchUser, updateUser} from '../../actions/firebase_actions';
import Loading from '../helpers/loading';
import ChangePassword from './change_password';
import { DATA_API, POST_API } from './Api';
import {Link} from 'react-router';
import { SplitButton, DropdownButton, MenuItem, Badge, Button, ButtonToolbar, FieldGroup, ButtonGroup, Tab, Tabs, Panel, ListGroup, ListGroupItem } from 'react-bootstrap';
export default Connect(mapStateToProps, mapDispatchToProps)(React.createClass({
componentWillMount () {
return fetch(DATA_API)
.then((response) => response.json())
.then((json) => {
// console.log(json);
this.setState({testapi: json});
});
this.props.fetchUser();
},
<div>
{data.filter(e => e.level === 1).map((x, index) => {
return (
<div key={x.id}>
{x.name}
<div/>
);
})}
</div>
import React from 'react';
import Paper from 'material-ui/Paper';
class SearchBar extends React.Component {
state = {
test:false,
};
componentWillMount(){
this.setState({ test: !this.state.test }, () => { this.focus(); });
}
import React from 'react';
import { render } from 'react-dom';
import * as _ from "lodash";
import './style.css'
class App extends React.Component {
state = {
geni: [
{ id: 10, a: 'Beta', b: 811 },
import React from "react"
import { render } from "react-dom"
class App extends React.Component {
state = { highlight: "", pos: "" }
getText = e => {
this.setState({
highlight: window.getSelection().toString(),
pos: window.getSelection()
})
@yarnball
yarnball / .css
Last active March 21, 2018 01:16
Text ellipse overlap using CSS only
.description {
/* hide text if it more than N lines */
@include font-size(2);
margin-top: units(0.5);
padding: 0 units(0.5);
overflow: hidden;
/* for set '...' in absolute position */
position: relative;
max-height: units(5);
/* fix problem when last visible word doesn't adjoin right side */
@yarnball
yarnball / ShareDbVue
Created August 7, 2019 21:37
ShareDB using Vue
<template>
<div id="app">
{{socketState}}<br/>
<input v-on:keyup.enter='addPlayer($event)' placeholder="Add player" v-model='newPlayer' />
<div v-for='p in Object.values(playerList).sort( (a,b) => b.created - a.created)' :key='p.id'>
{{p.name}}
<input v-model='playerList[p.id].name' @input='updatePlayer($event, p.id)' /><button :disabled='delInPrg.includes(p.id)' @click='rmvPlayer(p.id)'>[x]</button>
</div>
</div>