Skip to content

Instantly share code, notes, and snippets.

View Aaronius's full-sized avatar

Aaron Hardy Aaronius

View GitHub Profile
@bradwestfall
bradwestfall / S3-Static-Sites.md
Last active April 10, 2024 16:40
Use S3 and CloudFront to host Static Single Page Apps (SPAs) with HTTPs and www-redirects. Also covers deployments.

S3 Static Sites

⚠ This post is fairly old. I don't keep it up to date. Be sure to see comments where some people have posted updates

What this will cover

  • Host a static website at S3
  • Redirect www.website.com to website.com
  • Website can be an SPA (requiring all requests to return index.html)
  • Free AWS SSL certs
  • Deployment with CDN invalidation
@yossorion
yossorion / what-i-wish-id-known-about-equity-before-joining-a-unicorn.md
Last active April 7, 2024 22:55
What I Wish I'd Known About Equity Before Joining A Unicorn

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@SimplGy
SimplGy / anchorize-jekyll-headings.js
Last active October 31, 2022 17:20
For every heading in your page, this adds a little anchor link `#` that you can click to get a permalink to the heading. No dependency on jQuery or anything else. Requires that your headings already have an `id` attribute set (because that's what jekyll does)To use it, just drop it in the layout you use for your blog pages. You can style `.deepL…
(function(){
'use strict';
/*
Create intra-page links
Requires that your headings already have an `id` attribute set (because that's what jekyll does)
For every heading in your page, this adds a little anchor link `#` that you can click to get a permalink to the heading.
Ignores `h1`, because you should only have one per page.
The text content of the tag is used to generate the link, so it will fail "gracefully-ish" if you have duplicate heading text.
*/
@sebmarkbage
sebmarkbage / lower-case-convention.md
Last active May 16, 2022 13:48
React JSX - Lower Case

Lower Case JSX Convention

All lower case JSX tags will now be treated as HTML/SVG elements. They will no longer be treated as custom components in scope.

The React element produced by JSX can be either a React class that exists in the local scope or a global scope HTML/SVG element depending on a convention.

Previous Behavior

Currently, when you use React JSX to define a HTML element you can use any known HTML tag. E.g:

@staltz
staltz / introrx.md
Last active May 3, 2024 13:00
The introduction to Reactive Programming you've been missing
@iammerrick
iammerrick / Result
Created May 4, 2013 22:10
Angular.js + MessageFormat.js
-----------
Hello!
-----------
You have 5 messages.
-----------
*******
@shogun70
shogun70 / gist:5388420
Last active November 6, 2017 20:02
Log `document.readyState` for various stages of markup parsing and events.
<!DOCTYPE html>
<script type="text/javascript">
var addEvent = document.addEventListener ?
function(node, name, fn) { node.addEventListener(name, fn, false); } :
function(node, name, fn) { node.attachEvent('on' + name, fn); }
var begin = +new Date;
var log = [];
log.push('Event, Time: readyState, EOF');
function logEvent(name) {
@mxriverlynn
mxriverlynn / createObject.js
Created October 26, 2012 14:30
An Object.create wrapper / shim for MarionetteJS
// Helpers
// -------
// For slicing `arguments` in functions
var slice = Array.prototype.slice;
// Borrow the Backbone `extend` method so we can use it as needed
Marionette.extend = Backbone.Model.extend;
// A wrapper / shim for `Object.create`. Uses native `Object.create`
@Mithrandir0x
Mithrandir0x / gist:3639232
Created September 5, 2012 16:15
Difference between Service, Factory and Provider in AngularJS
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@jed
jed / LICENSE.txt
Created May 20, 2011 13:27 — forked from 140bytes/LICENSE.txt
generate random UUIDs
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE