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
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |
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
import mobx from "mobx" | |
import store from "store" | |
export default function(_this) { | |
let firstRun = true | |
// will run on change | |
mobx.autorun(() => { | |
// on load check if there's an existing store on localStorage and extend the store | |
if (firstRun) { |
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
import mobx, { computed, observable, action } from "mobx" | |
import store from "store" | |
import autoStore from "./autoStore" | |
class Auth { | |
constructor() { | |
autoStore("authentication", this) | |
} |
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 |
OlderNewer