Skip to content

Instantly share code, notes, and snippets.

View talves's full-sized avatar
☠️
Coding

Tony Alves talves

☠️
Coding
View GitHub Profile
@talves
talves / front-matter.md
Created October 21, 2017 06:55
Shortcode Hugo example for a link button

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" %}}

@talves
talves / netlify.toml
Created December 2, 2017 16:05
Basic Netlify Build file for Hugo. Allows for targeting versions in previews.
# Global settings applied to the whole site.
[build]
publish = "public"
command = "hugo -d public"
[build.environment]
#overwritten by context.production.environment, et. al.
HUGO_VERSION = "0.31"
# The following environments overwrite the global above if you target them.
# The version you use for production
[context.production.environment]
@talves
talves / control.js
Last active March 21, 2018 20:32 — forked from domtalbot/control.js
Netlify Custom Widget
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) {
super(props);
import { Component } from 'react'
export default class MicroState extends Component {
constructor (props) {
super(props)
this.state = props.state
}
render () {
return (this.props.render || this.props.children)({
setState: (...args) => this.setState(...args),
@talves
talves / process-date.js
Created April 18, 2018 18:08
Markdown pre-build script
#!/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')

Folder Structure

Motivations

  • 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)
@talves
talves / use-firebase-auth.jsx
Last active August 26, 2019 22:10 — forked from gragland/use-auth.jsx
React Hook recipe from https://usehooks.com
// Top level App component
import React from "react";
import { ProvideAuth } from "./use-auth.js";
// Add your Firebase credentials as config
const config = {
apiKey: "",
authDomain: "",
projectId: "",
appID: ""
@talves
talves / README.md
Created September 15, 2019 18:10 — forked from roachhd/README.md
EMOJI cheatsheet 😛😳😗😓🙉😸🙈🙊😽💀💢💥✨💏👫👄👃👀👛👛🗼🔮🔮🎄🎅👻

EMOJI CHEAT SHEET

Emoji emoticons listed on this page are supported on Campfire, GitHub, Basecamp, Redbooth, Trac, Flowdock, Sprint.ly, Kandan, Textbox.io, Kippt, Redmine, JabbR, Trello, Hall, plug.dj, Qiita, Zendesk, Ruby China, Grove, Idobata, NodeBB Forums, Slack, Streamup, OrganisedMinds, Hackpad, Cryptbin, Kato, Reportedly, Cheerful Ghost, IRCCloud, Dashcube, MyVideoGameList, Subrosa, Sococo, Quip, And Bang, Bonusly, Discourse, Ello, and Twemoji Awesome. However some of the emoji codes are not super easy to remember, so here is a little cheat sheet. ✈ Got flash enabled? Click the emoji code and it will be copied to your clipboard.

People

:bowtie: 😄