Skip to content

Instantly share code, notes, and snippets.

View danielzen's full-sized avatar

Daniel Zen danielzen

View GitHub Profile
@danielzen
danielzen / ssh-copy-pub
Last active August 29, 2015 14:23
ssh-copy-pub: simpler version of ssh-copy-id for copying employee/contractor public keys to remote server authorized_keys file
#!/bin/sh
display_usage() {
echo "This script must be run with at least 2 arguments."
echo "\nUsage:\n$0 pubKeyFile {ssh arguments}\n"
echo "Example: ssh-copy-pub john_rsa.pub root@server.example.com\n"
}
if [ $# -lt 2 ]
then
display_usage
exit 1
@danielzen
danielzen / .eslintrc.json
Created December 12, 2016 20:04
My eslint file for React Development (depends on react & jasmine plugins
{
"parser": "babel-eslint",
"env": {
"browser": true,
"node": true,
"es6": true,
"jasmine": true
},
"globals": {
"React": false,
@danielzen
danielzen / .editorconfig
Created December 13, 2016 20:34
Typical .editorconfig
# Editor configuration, see http://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
body {
padding: 30px;
font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
}
h1{
color: #fff;
}
a {
color: #00B7FF;
cursor: pointer;

Keybase proof

I hereby claim:

  • I am danielzen on github.
  • I am danielzen (https://keybase.io/danielzen) on keybase.
  • I have a public key ASBe7eEOs5edHtZiBJW8Aj8Ew4uhKXGnec2T0Y5H8W5DvQo

To claim this, I am signing this object:

@danielzen
danielzen / nvm-lazy.sh
Last active January 10, 2024 16:30
nvm lazy-load for zsh
# This script should be sourced from .zprofile to take advantage of the $ZSH_EXECUTION_STRING check
export NVM_DIR="$HOME/.nvm"
export NVM_SYMLINK_CURRENT=true
NODE_VERSION_DIR=$(readlink ~/.nvm/current) # Assumes ~/.nvm/current is linked
__NODE_GLOBALS=("${(@f)$(find "$NODE_VERSION_DIR"/bin -maxdepth 1 -mindepth 1 -type l -print0 | xargs --null -n1 basename | sort --unique)}")
__NODE_GLOBALS+=(node nvm)
found=false
for value in "${__NODE_GLOBALS[@]}"; do
# if zsh is trying to execute a command that matches one of the node globals in the current version