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 './modernizr' | |
// Modernizr | |
// https://modernizr.com/docs | |
Modernizr.addTest('support', function() { | |
if ( | |
Modernizr.svg && | |
Modernizr.cssanimations && | |
Modernizr.boxsizing && | |
Modernizr.flexbox && |
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, PropTypes } from 'react' | |
import { connect } from 'react-redux' | |
import { actionsCreator } from 'actions' | |
// References | |
// http://blog.teamtreehouse.com/learn-asynchronous-image-loading-javascript | |
@connect( | |
state => state, | |
dispatch => actionsCreator(dispatch) |
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, PropTypes } from 'react'; | |
import { graphql } from 'react-apollo' | |
import gql from 'graphql-tag' | |
import update from 'immutability-helper' | |
import { Toggler, colors } from "./Toggler" | |
import View from "react-flexbox" | |
@graphql(gql` |
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
const authorization = "Bearer abcefghijklmnopqrstu.vwxyzABCDEFGHIJKLMNOPQ.RSTUVWXYZ0123456789" | |
// (?:__) no selection group | |
// (__)? optional selection group | |
// (__) selection group | |
// searchers for digits seperated by three dots xx.xx.xx with an optional "Bearer " | |
// retrieve only the jwt (without Bearer) | |
const jwt = authorization.match(/(?:Bearer\s+)?(\w+\.\w+\.\w+)/)[1] // "abcef..." |
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
const ProfileType = new GraphQLObjectType({ | |
name: 'Profile', | |
description: 'User Profile', | |
fields: { | |
email: {type: new GraphQLNonNull(GraphQLString)}, | |
username: { | |
type: new GraphQLNonNull(GraphQLString), | |
resolve(profile) { | |
return profile.split("@")[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
// better file checker | |
// https://nodejs.org/dist/latest-v7.x/docs/api/fs.html#fs_fs_readfilesync_file_options | |
fs.accessSync(path.resolve(__dirname,'./config-local.json'), fs.R_OK); | |
// add .env.js |
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
let x = 0 | |
console.log(x) | |
let y = 1 | |
console.log(y) | |
let z = 0 | |
for (let i=0; i < 20; i++) { | |
z = x + y |
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
git flow bugfix vs hotfix | |
bugfix -> develop | |
hotfix -> 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" | |
export default function hoverDecorator(InitialComponent) { | |
return class HoverDecorator extends Component { | |
constructor() { | |
super() | |
this.state = { | |
hover: false | |
} |
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
const stateFiles = [ | |
{name: 'john'}, | |
{name: 'lewis'}, | |
] | |
const files = [ | |
{name: 'ana'}, | |
{name: 'john', email: "john@mail.com"}, | |
] |
OlderNewer