Skip to content

Instantly share code, notes, and snippets.

View beshur's full-sized avatar

Alex Buznik beshur

View GitHub Profile
@beshur
beshur / computer-sale.md
Last active December 8, 2015 12:12
computer-sale.md

Продаю некогда облюбованный и долгожданный компьютер.

Хотелка 6000 грн. Пока только комплектом.

@beshur
beshur / router.js
Created December 11, 2015 13:14
javascript microRouter
// micro Router for Front-end
//
// Deps: Require.js
//
// Tries to get the first portion ('folder') of the current location
// using Require.js and evaluate it;
//
// Alex Buznik ([email protected]), 2015
var Router = function() {
this.routes = {
@beshur
beshur / check.js
Created February 11, 2016 09:09
javascript Check if object in event is an input
var isInput = function(e) {
return (e.srcElement.contentEditable === "true"
|| e.srcElement == 'textarea' || e.srcElement == 'textarea');
}
@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);
};
@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 = [email protected]: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 / 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 / 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 / пше
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 / 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 / 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