This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Example usage: sizes path/to/somewhere/ | |
sizes () | |
{ | |
ls -lrt -d -1 ${PWD}/${1}* | xargs du -sh | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Insert these at the beginning of an existing sshd_config file | |
KexAlgorithms [email protected] | |
Ciphers [email protected],[email protected],[email protected],aes256-ctr,aes192-ctr,aes128-ctr | |
MACs [email protected],[email protected],[email protected],[email protected],hmac-sha2-512,hmac-sha2-256,hmac-ripemd160,[email protected] | |
Protocol 2 | |
HostKey /etc/ssh/ssh_host_ed25519_key | |
HostKey /etc/ssh/ssh_host_rsa_key | |
PasswordAuthentication no | |
ChallengeResponseAuthentication no |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Insert these at the beginning of an existing ssh_config file | |
# Github needs diffie-hellman-group-exchange-sha1 some of the time but not always. | |
Host github.com | |
KexAlgorithms [email protected],diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1 | |
Host * | |
KexAlgorithms [email protected],diffie-hellman-group-exchange-sha256 | |
HostKeyAlgorithms [email protected],[email protected],ssh-ed25519,ssh-rsa | |
Ciphers [email protected],[email protected],[email protected],aes256-ctr,aes192-ctr,aes128-ctr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"extends": "airbnb", | |
"rules": { | |
"no-multiple-empty-lines": [2, {"max": 2, "maxEOF": 2}] | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"presets": [ | |
"es2015", | |
"react" | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -l | |
# Recursively greps files for pattern match | |
search() { | |
usage='Usage: search PATTERN [directory]' | |
search_dir='.' | |
# Return usage if 0 or more than 2 args are passed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -l | |
# Recursively performs a perl replace on files in current or specified directory | |
# ...took me all afternoon to get it right. | |
# Examples: | |
# replace 's/stringtofind/stringtoreplacewith/g' | |
# replace 's/foo/bar/g' path/to/dir | |
replace() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { saveItem } from '../actions/TodoActions.js'; | |
export default class EditTodo extends React.Component { | |
constructor(props) { | |
super(props); | |
this._onChange = this._onChange.bind(this); | |
this._save = this._save.bind(this); | |
this._catchEnter = this._catchEnter.bind(this); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Todo app dispatcher with actions responding to both | |
// view and server actions | |
import { Dispatcher } from 'flux'; | |
class DispatcherClass extends Dispatcher { | |
handleViewAction(action) { | |
this.dispatch({ | |
source: 'VIEW_ACTION', | |
action: action, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Todo store | |
// | |
// Requiring the Dispatcher, Constants, and | |
// event emitter dependencies | |
import AppDispatcher from '../dispatcher/AppDispatcher'; | |
import { TodoConstants } from '../constants/TodoConstants'; | |
import { EventEmitter } from 'events'; | |
const CHANGE_EVENT = 'change'; |