Skip to content

Instantly share code, notes, and snippets.

Marian Kostadinov kapitancho

Block or report user

Report or block kapitancho

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
kapitancho / es6.js
Created Dec 24, 2015
RequireJS plugin for es6 + babel 6.
View es6.js
define(['module'], function (module) {
'use strict';
var fetchText = function(url, callback) {
var xhr = new XMLHttpRequest();'GET', url, true);
xhr.onreadystatechange = function(evt) {
if (xhr.readyState === 4) {
kapitancho / nodeclick.html
Created Oct 17, 2015
Nodeclick mini function
View nodeclick.html
<!DOCTYPE html>
//Add a single event listener that handles one or more actions based on the data-* attributes.
var nodeclick = function (container, mapping, omitHref) {
container.addEventListener ('click', function(event) {
var el =;
while (el != container) {
if (el.href && omitHref !== false) return;
kapitancho / demo.html
Created Mar 21, 2013
Rotate an image in a canvas
View demo.html
<!DOCTYPE html>
<html lang="en">
* {
margin: 0;
padding: 0;
canvas {
outline: solid 1px black;
kapitancho / gist:5099504
Created Mar 6, 2013
IE 6 and IE 7 solution for generated content. This example shows how to emulate generated content in IE6 and IE7. It shows how to use content:attr (attribute name) and content : 'some text' and how to style the generated elements. Known issues: As the example below shows, a skew transition is applied to an element and to a :before element. Unfor…
View gist:5099504
<!DOCTYPE html>
.test {
background: red;
zoom: expression(
this.insertBefore( document.createElement("before"), this.firstChild ).innerHTML = this.getAttribute ('data-for-before'),
this.appendChild( document.createElement("after") ).innerHTML = ' after-content '
kapitancho / inline-block.html
Created Jul 19, 2012
Cross-browser use of inline-block with spacing issues resolved for any font-family and font-size
View inline-block.html
<!DOCTYPE html>
html, body {
margin: 0;
padding: 0;
font-size: 15px;
font-family: Arial;
overflow: hidden;
You can’t perform that action at this time.