Skip to content

Instantly share code, notes, and snippets.

View siakaramalegos's full-sized avatar
🦄

Sia siakaramalegos

🦄
View GitHub Profile
@siakaramalegos
siakaramalegos / resources.md
Last active December 6, 2017 17:03
Resources for class on professionalism

Resources on Professionalism

This list was prepared for a class on professionalism in software engineering taught at Loyola University, New Orleans. The topics were communication, credibility, sexual harassment, and discrimination.

@siakaramalegos
siakaramalegos / lightning_fast_react_agentconf.readme
Created January 24, 2018 10:48
Lightning Fast React Apps - slides and resources from my presentation at Agent Conf
# Lightning Fast React Apps
## Slides
If you attended my talk, and want to find the slides, you can check them out [here](https://speakerdeck.com/siakaramalegos/lightning-fast-react-apps). Here are all the extra resources I shared in that presentation:
## Resources
### Slide resources and extra reading
Resouces linked in presented slides, but not in the resource list slide.
@siakaramalegos
siakaramalegos / webpack.config.js
Created February 2, 2018 15:35
An incomplete snippet of my static app Webpack configuration
const nodeModulesPath = path.resolve(__dirname, 'node_modules');
const faviconsPath = path.resolve(__dirname, 'app/favicons/');
// ...
const commonConfig = merge([{
context: path.resolve(__dirname, 'app'),
entry: {
index: './javascripts/index.js',
base: './javascripts/base.js',
},
@siakaramalegos
siakaramalegos / webpack_snippet.js
Created February 2, 2018 16:22
webpack.config.js HTML loader snippet
// webpack.config.js HTML loader snippet
{
test: /\.html$/,
exclude: [nodeModulesPath],
use: [
{ loader: 'file-loader', options: { name: '[name].[ext]' } },
'extract-loader',
{ loader: 'html-loader', options: { minimize: true } },
]
}
@siakaramalegos
siakaramalegos / favicons.js
Created February 2, 2018 16:24
Loader for all favicon files
// favicons.js
// Require all files in the favicon directory
function requireAll(r) { r.keys().forEach(r); }
requireAll(require.context(
'../../favicons/',
true,
/\.(png|xml|ico|json)$/)
);
@siakaramalegos
siakaramalegos / webpack_favicons.js
Last active February 2, 2018 16:27
webpack.config.js favicon file loading snippet
// webpack.config.js favicon file loading snippet
const nodeModulesPath = path.resolve(__dirname, 'node_modules');
const faviconsPath = path.resolve(__dirname, 'app/favicons/');
// ...
const commonConfig = merge([{
// ...
module: {
rules: [
// Favicons - just pass through to root using same file name
@siakaramalegos
siakaramalegos / favicons.html
Created February 2, 2018 17:00
Head links for favicons
<!-- Favicons -->
<link rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png">
@siakaramalegos
siakaramalegos / performance_matters.md
Last active March 23, 2018 20:33
Performance Matters slides and resources

Performance Matters

The slides from my talk are here on SpeakerDeck.

Want to check out some cool links and resources too? Here you go:

@siakaramalegos
siakaramalegos / CreditCardElement.js
Last active March 1, 2018 22:38
Displaying Card Errors with React Stripe Elements
import React, { Component } from 'react';
import { CardElement } from 'react-stripe-elements';
import isEmpty from 'lodash/isEmpty';
class CreditCardInput extends Component {
constructor() {
super()
this.state = { error: undefined }
}
@siakaramalegos
siakaramalegos / Timer.js
Created March 11, 2018 20:55
Countdown timer component using requestAnimationFrame
class Timer extends Component {
constructor(props) {
super(props)
// here, getTimeRemaining is a helper function that returns an
// object with { total, seconds, minutes, hours, days }
this.state = { timeLeft: getTimeRemaining(props.expiresAt) }
}
// Wait until the component has mounted to start the animation frame
componentDidMount() {