Skip to content

Instantly share code, notes, and snippets.

Sergey Kruk lonelyelk

View GitHub Profile
@lonelyelk
lonelyelk / generate key pair.sh
Created Jun 15, 2018
Asymmetric JWT token with Go
View generate key pair.sh
ssh-keygen -t rsa -b 2048 -f jwtRS256.key
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
@lonelyelk
lonelyelk / fastping.sh
Last active Mar 30, 2016
Fast and furious ping routine to detect if Internet is accessible or a computer is online.
View fastping.sh
#!/bin/bash
cnt=${2:-3}
to=${3:-1}
rcvd=$(set -o pipefail; timeout $to ping -A -s16 -c$cnt -q $1 2> /dev/null | grep received | awk -F', ' '{print $2}' | awk '{print $1}')
if [[ $? != 0 || $cnt != $rcvd ]]; then
exit 1
fi
@lonelyelk
lonelyelk / elk_reporter.js
Last active Mar 2, 2016
ElkReporter for jasmine when running tests in terminal (e.g. node). Made from jasmine standard ConsoleReporter.
View elk_reporter.js
/**
* This is modified version of Jasmine.js ConsoleReporter
*/
module.exports = exports = ElkReporter;
function Timer(options) {
options = options || {};
var now = options.now || (function (Date) { return function () { return new Date().getTime(); }; })(Date),
startTime;
View lonelyelk_pubkey.asc.txt
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2
mQINBFRU19UBEAD8+079s2G8XT5Gn2kRL1IZ9pqAJyeirBiz2CvragL/XmuAGhS0
7QIpPO8DNiXkDSjNYImPM56/qz/lyhTgirCRtWopEuH62LIqa2DDp1+B3WDp00OO
vbPSDvSJo/uVRxOF28QC4LmSXLUJeCa4B+RnQHvRfkNhKB9ridnBRVmlmxN3Hvki
OF0Vb6qRI+0ga6owX3+xxHiBLU6+RRWyy7cbx5p3meVii+xaAuc+1OLCQr4urPBg
nMEAkWeQFA4LAdDkX1qH0O19n621wXPTwfy9L0Q4vaPHA1GC/fw/QlGEAxaXtDu3
dwpRJ7N7btPth8fa6fSv9AKXJeQDV4xYLPWyX7Orz7Zfu55vKQ7uY00czqe4UnLu
fnL+RA0uZbgLdDrTDUxOXLnvuiANhY4PCCGXR5XWMRSoFcyWZQPQTQcFCojZixp2
@lonelyelk
lonelyelk / fbBefriended.user.js
Last active Aug 29, 2015
UserScript для удаления записей о том, кто с кем стал друзьями из фильтров (списков).
View fbBefriended.user.js
// ==UserScript==
// @name fbBefriended
// @description Remove friending notifocations from list feed
// @author Sergey Kruk
// @license MIT
// @version 0.0.4
// @match https://www.facebook.com/lists/*
// ==/UserScript==
(function (window, undefined) {
var main = window.document.getElementById("stream_pagelet");
View gist:225378
s = "abc"
s.class == String # => true
s.class === String # => false
String === s.class # => false
s === String # => false
String === s # => true
You can’t perform that action at this time.