Skip to content

Instantly share code, notes, and snippets.

View eddywashere's full-sized avatar
🔥
loading...

Eddy Hernandez eddywashere

🔥
loading...
View GitHub Profile
@piaverous
piaverous / setup_ssh_agent_with_apple_keychain.sh
Last active April 26, 2022 01:31
A simple bash snippet to add to your .bashrc or .zshrc in order to easily load password protected SSH Keys from the Apple Keychain, and never worry about them again !
###
# SSH keys setup with Apple keychain
###
if [ -z "$SSH_AUTH_SOCK" ] && [ -z "$SSH_AGENT_PID" ]; then
# If no SSH Agent is running, start one and load keys from Apple keychain
eval `ssh-agent -s` &> /dev/null
ssh-add --apple-load-keychain &> /dev/null
else
if [ -z "$(ssh-add -l | grep SHA256)" ]; then
# If agent is running but has no keys, load keys from Apple keychain
@olexpono
olexpono / .tmux.conf
Last active May 4, 2022 20:19
tmux.conf 2017
# use 256 term for pretty colors
set -g default-terminal "xterm-256color"
set -g status-bg black
set -g status-fg green
set-window-option -g clock-mode-colour brightyellow
# increase scroll-back history
set -g history-limit 1000000
# use vim key bindings
@bradgignac
bradgignac / main.tf
Created January 11, 2017 14:41
Terraform Example
/* Providers */
provider "aws" {
region = "us-west-2"
}
/* Variables */
variable "name" {
default = "XXXXX"
@danieleggert
danieleggert / GPG and git on macOS.md
Last active April 10, 2024 22:15
How to set up git to use the GPG Suite

GPG and git on macOS

Setup

No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

  1. Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for https://keybase.io
  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
RickWong / react.html
Last active April 20, 2021 15:48
Write React apps in 1 HTML file.
<html>
<body>
<div id="react-root"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-with-addons.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-dom.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.5.2/redux.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.7.7/babel.min.js"></script>
<script id="react-app" type="text/template">
const App = ({name}) => {
function createDisabledUntilClientRendersComponent(component, displayName='ClientComponent') {
return React.createClass({
displayName,
propTypes: {
disabled: React.PropTypes.bool
},
getInitialState() {
@lambtron
lambtron / sorter.js
Created October 20, 2015 17:27
Custom sort method for metalsmith-collections plugin in Segment's technical documentation.
/**
* 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
henrik / el_capitan.md
Last active May 1, 2023 18:24
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
mik01aj / README.md
Last active April 21, 2017 13:02
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
joepie91 / delay.js
Last active September 19, 2016 19:11
Bluebird Promise.delay for ES6 Promises
var Promise = require("es6-promise").Promise;
module.exports = function(delay){
return function(value) {
return new Promise(function(resolve, reject){
setTimeout(function(){
resolve(value);
}, delay)
});
}