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 | |
/* The trait method */ | |
public function queryGetAllUsersByEmailAndPermissions($query, $email) | |
{ | |
return $query->where('email', $email) | |
->where('permission', '>', 0); | |
} | |
/* One controller using the query as is. */ | |
public function getUsersWithEmail($email) |
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
#!/bin/bash | |
master="master" | |
# git-branch.sh dev | |
branch="$1" | |
git checkout $master | |
git fetch --all | |
git pull upstream $master |
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 logo from './logo.svg'; | |
import './App.css'; | |
class App extends Component { | |
render() { | |
return ( | |
<div className="App"> | |
<header className="App-header"> | |
<img src={logo} className="App-logo" alt="logo" /> |
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 logo from './logo.svg'; | |
import './App.css'; |
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
class App extends Component { | |
render() { | |
return ( | |
// We'll address the stuff here soon, don't worry! | |
); | |
} | |
} |
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
// Note: since this is ES5 syntax, we're using "var". | |
// When using ES6, it is best practice to only use "const" or "let" instead of "var". | |
var App = React.createClass({ | |
render: function () { | |
return ( | |
) | |
} | |
} |
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
render() { | |
return ( | |
<div className="App"> | |
<header className="App-header"> | |
<img src={logo} className="App-logo" alt="logo" /> | |
<h1 className="App-title">Welcome to React</h1> | |
</header> | |
<p className="App-intro"> | |
To get started, edit <code>src/App.js</code> and save to reload. | |
</p> |
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
render() { | |
return React.createElement( | |
"div", | |
{ className: "App" }, | |
React.createElement( | |
"header", | |
{ className: "App-header" }, | |
React.createElement("img", { src: logo, className: "App-logo", alt: "logo" }), | |
React.createElement( | |
"h1", |
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"; | |
export default class StarRating extends Component { | |
static defaultProps = { | |
minRating: 0, | |
maxRating: 10, | |
rating: 5, | |
starRatio: 2, | |
limit: 1000 | |
} |
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 logo from './logo.svg'; | |
import './App.css'; | |
// Add the following | |
import fontawesome from '@fortawesome/fontawesome' | |
import solid from '@fortawesome/fontawesome-free-solid' | |
import regular from '@fortawesome/fontawesome-free-regular' | |
fontawesome.library.add(solid, regular) |
OlderNewer