Skip to content

Instantly share code, notes, and snippets.

View ypetya's full-sized avatar
💭
🚀

Peter Kiss ypetya

💭
🚀
  • Budapest, Hungary
View GitHub Profile
@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
@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
@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)
@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
@szaboat
szaboat / olni_kell_ekkerjoz.md
Last active September 23, 2015 12:03
Ölni kell

Ölni kell

De nem muszáj gyilkolni.

„de nem muszáj gyilkolni.

Szárnyasokat könnyű, galambnak, gyöngyösnek nyakát kicsavarni semmi. Csirkét se nehéz, összekötöd a lábát, óvatosan rálépsz, szárnyát összefogod, arra is rálépsz, nyakán kicsit megtéped a tollat, és éles késsel elvágod a torkát. Kacsát, libát is nagyjából így, de ott kell kis izom, pulykánál pláne.

Nyulat megfogod a hátsó lábánál, fejbevágod a kés nyelével, elkábul, lehet sinkelni elfele. Birka se gond, csak össze kell kötni a lábát, és torkon szúrni valahol a nyakcsigolya és a gége között. Kecskét nehéz ölni, megérzi a bajt, néz, sír, de ha ez nem hat meg, akkor úgy múlik el, mint a birka.

@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@lalyos
lalyos / jmp
Last active August 29, 2015 13:58
#!/bin/bash
JUMPER_LIST=$(curl -Ls https://gist.githubusercontent.com/lalyos/10364962/raw/jumper.list)
list() {
cat <<EOF
known jumpers:
$JUMPER_LIST
app.directive('faFastScroll', ['$parse', function ($parse) {
var Interval = function(min, max) {
this.min = min || 0;
this.max = max || 0;
};
Interval.prototype.clip = function(min, max) {
if(this.max <= min || this.min >= max) {
this.min = this.max = 0;
@jashkenas
jashkenas / semantic-pedantic.md
Last active July 13, 2024 04:25
Why Semantic Versioning Isn't

Spurred by recent events (https://news.ycombinator.com/item?id=8244700), this is a quick set of jotted-down thoughts about the state of "Semantic" Versioning, and why we should be fighting the good fight against it.

For a long time in the history of software, version numbers indicated the relative progress and change in a given piece of software. A major release (1.x.x) was major, a minor release (x.1.x) was minor, and a patch release was just a small patch. You could evaluate a given piece of software by name + version, and get a feeling for how far away version 2.0.1 was from version 2.8.0.

But Semantic Versioning (henceforth, SemVer), as specified at http://semver.org/, changes this to prioritize a mechanistic understanding of a codebase over a human one. Any "breaking" change to the software must be accompanied with a new major version number. It's alright for robots, but bad for us.

SemVer tries to compress a huge amount of information — the nature of the change, the percentage of users that wil