Skip to content

Instantly share code, notes, and snippets.

View beshur's full-sized avatar

Alex Buznik beshur

View GitHub Profile
@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 / 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 (shu@buznik.net), 2015
var Router = function() {
this.routes = {
@beshur
beshur / computer-sale.md
Last active December 8, 2015 12:12
computer-sale.md

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

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

@beshur
beshur / debounce.js
Created December 3, 2015 18:37
javascript debounce
/**
* Debounce creates a FUNCTION that when invoked, delays invoking func for wait milliseconds since
* the last time it is called.
*
* Examples of where this may be useful:
*
* // Avoiding repeated costly operations while a window size is in flux
* jQuery(window).on('resize', debounce(calculateLayout, 150));
*
* // Avoiding triggering an event on a double button press
@beshur
beshur / README.md
Last active December 1, 2015 15:40 — forked from mbostock/.block
Force-Directed Graph

This simple force-directed graph shows character co-occurence in Les Misérables. A physical simulation of charged particles and springs places related characters in closer proximity, while unrelated characters are farther apart. Layout algorithm inspired by Tim Dwyer and Thomas Jakobsen. Data based on character coappearence in Victor Hugo's Les Misérables, compiled by Donald Knuth.

Compare this display to a force layout with curved links, a force layout with fisheye distortion and a matrix diagram.

@beshur
beshur / data.json
Last active December 2, 2015 12:02
ezlo map mock data
{
"nodes": [
{"group":1, "neighbours":[3,7,8,9,10,11],"node_id":1},
{"group":1, "neighbours":[1],"node_id":3},
{"group":1, "neighbours":[1,8,9,10],"node_id":7},
{"group":2, "neighbours":[1,7,10,11],"node_id":8},
{"group":3, "neighbours":[1,7,10],"node_id":9},
{"group":1, "neighbours":[1,7,9,11],"node_id":10},
{"group":1, "neighbours":[1,7,9],"node_id":11}
]
@beshur
beshur / wp-jouele-2-svn.sh
Created November 25, 2015 21:47
bash wp-jouele I don't wanna use SVN copy-paste
echo "wp-jouele I don't wanna SVN deploy"
cd ~/work/htdocs/wp-test/wp-content/plugins
cp -R wp-jouele/* ~/work/wp-jouele/trunk
cd ~/work/wp-jouele
rm -rf .git
@beshur
beshur / popdown.md
Last active November 24, 2015 12:55
Idea: Pop-up remover Chrome Extension
@beshur
beshur / gm-fsdfm.php
Last active August 29, 2015 14:24 — forked from gmazzap/gm-fsdfm.php
<?php namespace GM\FSDFM;
/**
* Plugin Name: Fullscreen Distraction-Free Mode (pre v4.1)
* Description: Allows to use the distraction-free mode that was active pre 4.1 WP version.
* Plugin URI: https://gist.github.com/Giuseppe-Mazzapica/c081ce03a68b00d983d5
* Author: Giuseppe Mazzapica
* Author URI: https://gm.zoomlab.it
* License: MIT
* Version: 1.0.0
*/
@beshur
beshur / scss.scss
Last active August 29, 2015 14:21
scss trick with ears
.b_imageload {
&__thumbnail {
color: green;
&--profile & {
color: red;
}
}