Skip to content

Instantly share code, notes, and snippets.

View ypetya's full-sized avatar
💭
🚀

Peter Kiss ypetya

💭
🚀
  • Budapest, Hungary
View GitHub Profile
@trinitronx
trinitronx / set_git_email_vars.sh
Last active March 8, 2022 14:48
Function to set git author & committer email addresses based on your cwd
# Original Gist: https://gist.github.com/trinitronx/5979265
# RP Gist: https://gist.github.com/returnpathadmin/dbffee1d3d675f271435
# Function to set git author & committer email addresses based on your cwd
# Uses the very first .gitemail file found while traversing up directories
# Use case: As a developer,
# Given that I have a .gitemail file in my work directory containing my work email
# When I am in the work directory
# Then I should be able to commit with my work email address
# Given that I have a .gitemail file in my public directory containing my public email
# When I am in the public directory
@kwokhou
kwokhou / angular-autoNumeric.js
Last active April 22, 2024 21:54
AngularJS directive for autoNumeric.js
// Directive for autoNumeric.js
// Require AngularJS, jQuery and autoNumeric.js
angular.module('crunch.ui.numeric', []).directive('crNumeric', [function () {
'use strict';
// Declare a empty options object
var options = {};
return {
// Require ng-model in the element attribute for watching changes.
require: '?ngModel',
// This directive only works when used in element's attribute (e.g: cr-numeric)
@ypetya
ypetya / .bashrc
Last active December 19, 2015 08:29
ssh Host completion by .ssh/config and known_hosts files in case their exists.
# ssh completion
if [ -f ~/.ssh/config ] ; then
SSH_COMPLETE=( $(grep "^Host " ~/.ssh/config | cut -f2 -d ' ' | sort -u ) )
SSH_COMPLETE=( ${SSH_COMPLETE[*]} $(grep "\w*User " ~/.ssh/config | cut -f2 -d ' ' | sort -u ) )
fi
if [ -f ~/.ssh/known_hosts ] ; then
SSH_COMPLETE=( ${SSH_COMPLETE[*]} $(cut -f1 -d' ' ~/.ssh/known_hosts | cut -f1 -d',' | sort -u ))
fi
complete -o default -W "${SSH_COMPLETE[*]}" ssh
complete -o default -W "${SSH_COMPLETE[*]}" scp
@lalyos
lalyos / ssh-key-ok.sh
Last active December 11, 2015 02:28
#!/bin/bash
mkdir -p .ssh
chmod 700 .ssh
cat >>~/.ssh/authorized_keys<<EOF
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6SN3kVFVplUtTpag/S8XRUiV/z2IXXVD3EzCAI8pUceIfM3JfoskEwMwxwegjJlP16SYmMfn7TY0Ieah9Z8Fb3dcdh+pqe/e3Jg32BzLARgd4tpOHc+qBJjdzB5pWKdM9XEqolUOyivxb+9nA/zSZokxayXMk2dR437MtvCZeICTnAW5ZC6BjdxlvarNQJyte8/IaiOKI+LpzFPwmY/+Dol6sMZ3LgFibodxqwq7SjRDN65mLkJXJxUF7yfT5tMCNgL1ULdL3LOmO/mEsWQI712AWfT/8+iGHKpkN809PG70nhBKTn52z4nBVEtw+kS4z5fEjFfzfYlrwML2rQ5YoQ== lalyos@ephubudl0127
EOF
chmod 644 ~/.ssh/authorized_keys