Instantly share code, notes, and snippets.


Tony Alves talves

View GitHub Profile

Folder Structure


  • Clear feature ownership
  • Module usage predictibility (refactoring, maintainence, you know what's shared, what's not, prevents accidental regressions, avoids huge directories of not-actually-reusable modules, etc)
View process-date.js
#!/usr/bin/env node
'use strict'
const fs = require('fs')
const path = require('path')
const matter = require('gray-matter')
const rootPath = path.resolve(__dirname, '../')
const dataPath = path.resolve(rootPath, './src/data/blog')
View MicroState.js
import { Component } from 'react'
export default class MicroState extends Component {
constructor (props) {
this.state = props.state
render () {
return (this.props.render || this.props.children)({
setState: (...args) => this.setState(...args),
View control.js
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { Map } from 'immutable';
import CMS from 'netlify-cms';
export default class DynamicControl extends React.Component {
constructor(props) {
View netlify.toml
# Global settings applied to the whole site.
publish = "public"
command = "hugo -d public"
#overwritten by context.production.environment, et. al.
# The following environments overwrite the global above if you target them.
# The version you use for production

This is an example of using the shortcode link-button-sc

A pretty easy button. :)

{{% link-button-sc href="#" class="my-button--raised crazy-button" value="Click Me Real Good" %}}

View settings.json
// Place your settings in this file to overwrite the default settings
"editor.fontSize": 16,
"editor.fontFamily": "Consolas",
"editor.tabSize": 2,
"editor.fontLigatures": true,
"editor.wordWrap": "wordWrapColumn",
"editor.wordWrapColumn": 80,
"files.exclude": {
"**/.git": true,

Keybase proof

I hereby claim:

  • I am talves on github.
  • I am talves ( on keybase.
  • I have a public key ASD6fOG65lyWkvDm4hBqJdPp7bAXJTF6WkB8h-trFITmrgo

To claim this, I am signing this object:

View SlideData.js
define(function(require, exports, module) {
var SlideData = {
picasaUrl: '',
queryParams: '?kind=photo&q=puppy&max-results=5&imgmax=720&alt=json',
defaultImage: ''
SlideData.getUrl = function() {
return SlideData.picasaUrl + SlideData.queryParams;
View index.html
<input type="file" id="fileInput" />
<div id="fileDisplayArea"></div>