Skip to content

Instantly share code, notes, and snippets.

View rubinchyk's full-sized avatar
🇮🇱

Alexey Rubinchyk rubinchyk

🇮🇱
View GitHub Profile
@matthiasbalke
matthiasbalke / add-ssh-key-non-interactive.sh
Created March 21, 2019 08:12
add ssh key non-interactive using expect
#!/usr/bin/expect -f
# https://unix.stackexchange.com/a/90869/91094
spawn ssh-add /home/user/.ssh/id_rsa
expect "Enter passphrase for /home/user/.ssh/id_rsa:"
send "passphrase\n";
expect "Identity added: /home/user/.ssh/id_rsa (/home/user/.ssh/id_rsa)"
interact
@supermoos
supermoos / main.ts
Last active April 1, 2019 22:58
TypeScript jQuery document ready
///<reference path="./typings/jquery/jquery.d.ts"/>
'use strict';
class Main {
constructor() {
jQuery(document).ready(() => {
console.log('Hello from app/scripts/ts/Main.ts');
});
}
}
@torgeir
torgeir / gulpfile.js
Last active June 12, 2023 09:52 — forked from markgoodyear/01-gulpfile.js
Example gulpfile.js
// Load plugins
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
jshint = require('gulp-jshint'),
uglify = require('gulp-uglify'),
imagemin = require('gulp-imagemin'),
rename = require('gulp-rename'),
clean = require('gulp-clean'),
@kerimdzhanov
kerimdzhanov / random.js
Last active June 25, 2024 19:41
JavaScript: get a random number from a specific range
/**
* Get a random floating point number between `min` and `max`.
*
* @param {number} min - min number
* @param {number} max - max number
* @return {number} a random floating point number
*/
function getRandomFloat(min, max) {
return Math.random() * (max - min) + min;
}
@rbialek
rbialek / config
Created June 7, 2011 13:32
ssh/.config
Host github.com
User git
Hostname github.com
PreferredAuthentications publickey
IdentityFile /home/user/.ssh/id_rsa