Skip to content

Instantly share code, notes, and snippets.

View aackerman's full-sized avatar
💻
Working

Aaron Ackerman aackerman

💻
Working
View GitHub Profile
@mjackson
mjackson / AutoBindingComponent.js
Created May 6, 2015 20:35
A React.Component subclass that mimics 0.12's auto-binding behavior
var React = require('react');
class AutoBindingComponent extends React.Component {
constructor(props) {
super(props);
for (var property in this) {
if (this.hasOwnProperty(property) && typeof this[property] === 'function') {
this[property] = this[property].bind(this);
}
@aackerman
aackerman / jasmine_helpers.js
Last active August 29, 2015 14:23
Auto-unmounting React components in Jasmine tests
import React from 'react';
import {mountNodes} from 'testing/render_test_utils';
// setup afterEach method to unmount all mounted nodes
jasmine.getEnv().topSuite().afterEach({
fn: () => {
while ( mountNodes.length ) {
let mountNode = mountNodes.pop();
React.unmountComponentAtNode(mountNode);
}
@lizthegrey
lizthegrey / attributes.rb
Last active August 29, 2025 15:40
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'