Skip to content

Instantly share code, notes, and snippets.


Eddy Hernandez eddywashere

View GitHub Profile
bradgignac /
Created Jan 11, 2017
Terraform Example
/* Providers */
provider "aws" {
region = "us-west-2"
/* Variables */
variable "name" {
default = "XXXXX"
danieleggert / GPG and git on
Last active Dec 3, 2021
How to set up git to use the GPG Suite
View GPG and git on

GPG and git on macOS


No need for homebrew or anything like that. Works with and the command line.

  1. Install -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for
  3. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  4. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys
RickWong / react.html
Last active Apr 20, 2021
Write React apps in 1 HTML file.
View react.html
<div id="react-root"></div>
<script src=""></script>
<script src=""></script>
<script type="text/javascript" src=""></script>
<script src=""></script>
<script id="react-app" type="text/template">
const App = ({name}) => {
View gist:456141c9e6fdbca6ab4f
function createDisabledUntilClientRendersComponent(component, displayName='ClientComponent') {
return React.createClass({
propTypes: {
disabled: React.PropTypes.bool
getInitialState() {
lambtron / sorter.js
Created Oct 20, 2015
Custom sort method for metalsmith-collections plugin in Segment's technical documentation.
View sorter.js
* Generate a custom sort method for given starting `order`. After the given
* order, it will ignore casing and put periods last. So for example a call of:
* sorter('Overview');
* That is passed:
* - Analytics.js
henrik /
Last active Jan 12, 2018
El Capitan update: Ruby, Rails, homebrew, VirtualBox/Vagrant, Elixir etc.

My notes from updating to El Capitan, as a Ruby/Rails developer working in VirtualBox/Vagrant.

VirtualBox and Vagrant

Our dev environment currently requires us to use older versions of VirtualBox (4.3) and Vagrant (1.7.1).

It seems the new "SIP" protection messes with that version of VirtualBox.

I tried upgrading VirtualBox (to 5.0.6) and Vagrant (to 1.7.4). Those seemed to run fine on El Capitan, but we rely on Chef v. 10 and Vagrant doesn't seem to get along with it (error: "invalid option: --force-formatter").

mik01aj /
Last active Apr 21, 2017
How to use Tether with React

Tether is a great library for positioning stuff (tooltips, modals, hints, etc) in your web app.

But, as I use React, it was pretty problematic for me, as Tether mutates the DOM and React breaks miserably when it sees mutated DOM. The solution is to have the tethered element outside the part of the DOM tree which is controlled by React (in this case, I use document.body).

That's why I created 2 helpers to use Tether with React.

The first one, TetheredElement is a plain JS helper to create a new element, attach it to some other one via Tether, and populate it with some React component.

The second one, TetherTarget is a React component and it uses TetheredElement to integrate it further with React, so that you can attach components to each other with Tether, without leaving the cozy React/JSX world and worrying about manual DOM operations. Just write:

joepie91 / delay.js
Last active Sep 19, 2016
Bluebird Promise.delay for ES6 Promises
View delay.js
var Promise = require("es6-promise").Promise;
module.exports = function(delay){
return function(value) {
return new Promise(function(resolve, reject){
}, delay)
stevemao /
Last active Aug 20, 2021 — forked from sindresorhus/
Publish node module
# npm publish with goodies
# prerequisites:
# `npm install -g trash conventional-recommended-bump conventional-changelog conventional-github-releaser conventional-commits-detector json`
# `np` with optional argument `patch`/`minor`/`major`/`<version>`
# defaults to conventional-recommended-bump
# and optional argument preset `angular`/ `jquery` ...
# defaults to conventional-commits-detector
np() {
travis status --no-interactive &&
trash node_modules &>/dev/null;
View on-jsx.markdown

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't