Skip to content

Instantly share code, notes, and snippets.

View beshur's full-sized avatar

Alex Buznik beshur

View GitHub Profile
@beshur
beshur / b_skeletons.js
Last active September 10, 2015 14:49
Backbone Collection Bootstrap - Skeleton
/** General Skeletons controller */
var Skeletons = Backbone.View.extend({
model: SkeletonsModel,
el: ".b_skeletons",
events: {
},
@beshur
beshur / getTpl.js
Created March 25, 2015 15:18
getTpl - underscore templates shorthand
function getTpl(tpl, options) {
if (!tpl) return;
if (!options) options = null;
var prepare = false;
if (options == 1) {
options = {};
prepare = true;
console.log('prepare');
}
@beshur
beshur / 0_reuse_code.js
Last active August 29, 2015 14:19
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@beshur
beshur / scss.scss
Last active August 29, 2015 14:21
scss trick with ears
.b_imageload {
&__thumbnail {
color: green;
&--profile & {
color: red;
}
}
@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 / popdown.md
Last active November 24, 2015 12:55
Idea: Pop-up remover Chrome Extension
@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 / 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 / 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 / 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