Skip to content

Instantly share code, notes, and snippets.

View beshur's full-sized avatar

Alex Buznik beshur

View GitHub Profile
describe('RequestRepeater functions', function() {
it('should make request and repeat it at least once', function(done) {
const requestRepeater = new RequestRepeater({
request: MOCK_REQUEST,
delay: 1000
})
let times = 0;
requestRepeater.requestAndRepeat()
requestRepeater.on('result', (result, error) => {
@beshur
beshur / userscripts.js
Last active November 15, 2018 13:30
[Tampermonkey] Quora Links Remover
// ==UserScript==
// @name Quora Links Remover
// @namespace http://tampermonkey.net/
// @version 0.1.1
// @description try to read Quora again!
// @author Alex Buznik
// @match https://www.quora.com/
// @grant none
// ==/UserScript==
@beshur
beshur / Gruntfile.js
Last active April 20, 2018 15:55
Chrome Extension Grunt Build Script
// Task configurations
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('manifest.json'),
bumpup: {
options: {
updateProps: {
pkg: 'manifest.json'
}
},
@beshur
beshur / convert.sh
Created April 3, 2018 11:56 — forked from akost/convert.sh
Bash script for recursive file convertion windows-1251 --> utf-8
#!/bin/bash
# Recursive file convertion windows-1251 --> utf-8
# Place this file in the root of your site, add execute permission and run
# Converts *.php, *.html, *.css, *.js files.
# To add file type by extension, e.g. *.cgi, add '-o -name "*.cgi"' to the find command
find ./ -name "*.php" -o -name "*.html" -o -name "*.css" -o -name "*.js" -type f |
while read file
do
@beshur
beshur / twirlTimer.css
Created November 11, 2016 15:52
twirlTimer
.block {
text-align: center;
}
.spinner {
padding: 15px 0;
display: inline-block;
font-size: 30px;
font-weight: bold;
}
@beshur
beshur / пше
Created June 27, 2016 13:50 — forked from piranha/пше
пше гит, прошу пана
#!/usr/bin/env python
# -*- mode: python, coding: utf-8 -*-
#
# This incredible piece of code makes git a bit Polish, a bit Western Ukrainian,
# пше прошу пана
# Joke is based on fact that 'git' is 'пше' in qwerty/йцукен layouts
#
# (c) 2013 Alexander Solovyov under terms of WTFPL
import sys
@beshur
beshur / test.js
Last active May 20, 2016 14:35
simple memory test
// simple memory test
var memoryTest = function() {
function clickTest() {
var test = 'clickTest ' + iteration;
if (this.timing) {
console.time(test);
} else {
console.info(test);
}
$(".plugintab label").each(function(i, el){$(el).find("span:first").click();})
@beshur
beshur / log.js
Created March 18, 2016 14:24
js Log wrapper and config for winston
/**
* Log wrapper and config
*
* @return module
*/
var winston = require('winston');
function getLogger(module) {
return new winston.Logger({
transports : [
@beshur
beshur / pr.md
Created March 18, 2016 11:38 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@beshur
beshur / lol.js
Created February 17, 2016 12:17 — forked from wesbos/lol.js
// paste in your console
speechSynthesis.onvoiceschanged = function() {
var msg = new SpeechSynthesisUtterance();
msg.voice = this.getVoices().filter(v => v.name == 'Cellos')[0];
msg.text = Object.keys(window).join(' ');
this.speak(msg);
};