made with esnextbin
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
function parseDuration(duration) { | |
let durationInSeconds = 0 | |
const hourIndex = duration.indexOf('h') | |
if(hourIndex > -1) { | |
let hours = parseInt(duration.substr(0, hourIndex), 10) | |
duration = duration.substr(hourIndex + 1) | |
durationInSeconds += hours * 60 * 60 | |
} |
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 from 'react' | |
import { observer } from 'mobx-react' | |
function ArtistList({ uiState: { artistData } }) { | |
const { data } = artistData; | |
if ( !data || !data.artists || !data.artists.length ) { | |
return <div>No artists bruh.</div> | |
} | |
const { artists } = data | |
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
import Ember from 'ember'; | |
import gql from 'graphql-tag' | |
const query = gql` | |
query pokedex { | |
pokedex { | |
pokemon(start: 0 number: 10) {edges {node {id 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
import Ember from 'ember'; | |
import { | |
times, | |
constant | |
} from 'lodash'; | |
const { | |
get, | |
set, | |
Component, |
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 Ember from 'ember'; | |
const { | |
Component, | |
on, | |
computed, | |
A: EArray, | |
} = Ember; | |
export default Component.extend({ |
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 { HTTPFetchNetworkInterface, printAST } from 'apollo-client'; | |
/** | |
* Serialize a object to a query string | |
* @source https://stackoverflow.com/questions/1714786/query-string-encoding-of-a-javascript-object#comment47677757_18116302 | |
*/ | |
function serialize( obj ) { | |
return `?` + Object.keys(obj).map(k => k + `=` + encodeURIComponent(obj[k])).join(`&`); | |
} |
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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
model: { | |
sumText: 'sum text', | |
}, | |
actions: { | |
changed() { | |
alert('onChange triggered') |
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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
actions: { | |
foo() { | |
alert('red box') | |
}, | |
bar(ev) { |
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 | |
namespace App\Providers; | |
use Illuminate\Support\Facades\Event; | |
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; | |
class EventServiceProvider extends ServiceProvider | |
{ |
OlderNewer