This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from "react"; | |
import ReactDom from "react-dom"; | |
const doneStyles = { | |
textDecoration: "line-through", | |
color: "grey" | |
}; | |
const buttonStyles = { | |
border: "none", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from "react"; | |
import ReactDOM from "react-dom"; | |
const wait = response => | |
new Promise(resolve => setTimeout(() => resolve(response), 3000)); | |
const handleErrors = response => { | |
if (response.status < 200 || response.status >= 300) { | |
throw new Error("Network Error"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from "react"; | |
import ReactDOM from "react-dom"; | |
function Todo(props) { | |
const { text, isDone, onToggle } = props; | |
const style = isDone ? { color: "grey", textDecoration: "line-through" } : {}; | |
return ( | |
<li> | |
<input |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from "react"; | |
import ReactDOM from "react-dom"; | |
class Time extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
date: new Date(), | |
count: 0 | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$blog = ($page->parents()->count() > 0)? $page->parents()->first() : $page; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class UserField extends SelectField { | |
public function input() { | |
$select = new Brick('select'); | |
$select->addClass('selectbox'); | |
$select->attr(array( | |
'name' => $this->name(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* no media query is for phone and larger (mobile first) */ | |
@media only screen and (min-width: @screen-sm-min) {} /* tablet (768px) and larger */ | |
@media only screen and (min-width: @screen-md-min) {} /* desktop (992px) and larger */ | |
@media only screen and (min-width: @screen-lg-min) {} /* wide destop (1200px) and larger */ | |
@media only screen and (max-width: @screen-xs-max) {} /* phone (767px) and smaller */ | |
@media only screen and (max-width: @screen-sm-max) {} /* tablet (991px) and smaller */ | |
@media only screen and (max-width: @screen-md-max) {} /* desktop (1199px) and smaller */ | |
/* no media query is also for wide desktop and smaller */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var resizeId; | |
$(window).resize(function() { | |
clearTimeout(resizeId); | |
resizeId = setTimeout(doneResizing, 500); | |
}); | |
function doneResizing(){ | |
//whatever we want to do | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[placeholder]:focus::-webkit-input-placeholder { | |
color: transparent; | |
} |
NewerOlder