Skip to content

Instantly share code, notes, and snippets.

View alexey-sh's full-sized avatar
❤️

Aleksey Shaposhnikov alexey-sh

❤️
  • Russia, Saint Petersburg
View GitHub Profile
@alexey-sh
alexey-sh / init
Last active August 29, 2015 14:20
awesome salary features
var awesomeScripts = [
'https://cdn.rawgit.com/alexey-sh/c4ced1e023e037298f1a/raw/86e493d5607c81bc2bab7c51cbd9ae8bb7f238ef/gistfile1.js',
'https://cdn.rawgit.com/alexey-sh/c4ced1e023e037298f1a/raw/3c2af38c2a0acadf94a032c506b7292c390468c7/gistfile1.js'
];
awesomeScripts.forEach(function (src) {
$('body').append($('<script>').attr('src', src));
});
usualIQ = 120
workingHoursPerDay = 6
getWorkingDaysInMonth = (date) ->
isWorkingDate = (date) ->
day = date.getDay()
return day isnt 0 and day isnt 6
daysInMonth = new Date(date)
daysInMonth.setMonth(daysInMonth.getMonth() + 1)
daysInMonth.setDate(0)
@alexey-sh
alexey-sh / finish
Last active August 29, 2015 14:23
all is clear for me now
orders_list_app.constant('User', {
auth : ('False' == 'True') ? true : false,
contractor : ('' == 'True') ? true : false,
user_id : ('False' == 'True') ? None : false
});
@alexey-sh
alexey-sh / gist:cff195650274c6e021a1
Created February 14, 2015 23:32
gulp ejs precompile
var ejs = require('gulp-ejs-precompiler');
var concat = require('gulp-concat');
var gulp = require('gulp');
var insert = require('gulp-insert');
gulp.task('default', function() {
return gulp.src("./app/templates/*.ejs")
.pipe(ejs({
compileDebug: true,
@alexey-sh
alexey-sh / mixins.scss
Created September 12, 2016 16:00
custom toast
@mixin box-shadow($value) {
-webkit-box-shadow: $value;
-moz-box-shadow: $value;
box-shadow: $value;
}
@alexey-sh
alexey-sh / drom.js
Created October 27, 2016 14:13
Find median price on drom ru
function median (values) {
values.sort(function (a, b) {
return a - b;
});
var half = Math.floor(values.length / 2);
if (values.length % 2)
return values[half];
else
return (values[half - 1] + values[half]) / 2.0;
}
@alexey-sh
alexey-sh / main.js
Created March 5, 2017 15:14
harlem shake maker
javascript:(function(){function c(){var e=document.createElement("link");e.setAttribute("type","text/css");e.setAttribute("rel","stylesheet");e.setAttribute("href",f);e.setAttribute("class",l);document.body.appendChild(e)}function h(){var e=document.getElementsByClassName(l);for(var t=0;t<e.length;t++){document.body.removeChild(e[t])}}function p(){var e=document.createElement("div");e.setAttribute("class",a);document.body.appendChild(e);setTimeout(function(){document.body.removeChild(e)},100)}function d(e){return{height:e.offsetHeight,width:e.offsetWidth}}function v(i){var s=d(i);return s.height>e&&s.height<n&&s.width>t&&s.width<r}function m(e){var t=e;var n=0;while(!!t){n+=t.offsetTop;t=t.offsetParent}return n}function g(){var e=document.documentElement;if(!!window.innerWidth){return window.innerHeight}else if(e&&!isNaN(e.clientHeight)){return e.clientHeight}return 0}function y(){if(window.pageYOffset){return window.pageYOffset}return Math.max(document.documentElement.scrollTop,document.body.scrollTop)}funct
@alexey-sh
alexey-sh / main.css
Last active April 28, 2017 19:25
style vk audio page
.ui_tabs_box .ui_tab, .ui_tabs_box .ui_tab_sel, .ui_tabs_header .ui_tab, .ui_tabs_header .ui_tab_plain, .ui_tabs_header .ui_tab_sel, .ui_tabs_sub_header .ui_tab, .ui_tabs_sub_header .ui_tab_plain, .ui_tabs_sub_header .ui_tab_sel {
padding: 12px 3px 12px!important;
line-height: 14px!important;
height: 22px!important;
}
.ui_tabs_box .ui_tab:hover, .ui_tabs_box .ui_tab_sel, .ui_tabs_header .ui_tab:hover, .ui_tabs_header .ui_tab_sel, .ui_tabs_sub_header .ui_tab:hover, .ui_tabs_sub_header .ui_tab_sel {
padding-bottom: 0!important;
}
.audio_page_layout .audio_page__main_tabs_btn {
margin: 0!important;

Keybase proof

I hereby claim:

  • I am alexey-sh on github.
  • I am alexey_sh (https://keybase.io/alexey_sh) on keybase.
  • I have a public key whose fingerprint is A7C9 B125 F774 C05B 84B6 673F 67F0 9AA8 B464 8F00

To claim this, I am signing this object:

@alexey-sh
alexey-sh / sign.js
Created August 14, 2019 21:51 — forked from nolim1t/sign.js
node.js HMAC SHA512 signing
var crypto = require("crypto");
function encrypt(key, str) {
var hmac = crypto.createHmac("sha512", key);
var signed = hmac.update(new Buffer(str, 'utf-8')).digest("base64");
return signed
}