Skip to content

Instantly share code, notes, and snippets.

Timur Kheyfets tkheyfets

Block or report user

Report or block tkheyfets

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
View sorted_union.js
const sortedUnion = (a, b) => {
const c = {};
[...a, ...b].forEach(i => c[i] = i);
return Object.keys(c);
View es6_remove.js
const remove = (index, array) =>
[...array.slice(0, index),
...array.slice(index + 1, array.length)];
tkheyfets / insert.js
Last active Apr 8, 2016
Array insert
View insert.js
function insert(item, index, array) {
array.splice(index, 0, item);
return array;
View es6_insert.js
const insert = (item, index, array) =>
[...array.slice(0, index),
...array.slice(index, array.length)];
tkheyfets / defer.js
Last active Mar 23, 2016
Force code to run in next drawing frame
View defer.js
function defer(fn) { return setTimeout(fn, 0); }
tkheyfets / chart.html
Last active Mar 23, 2016
Interactive chart with html and css
View chart.html
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width" />
<link rel="stylesheet" type="text/css" href="main.css" />
<title>CSS Chart</title>
<div class="bars-wrapper">
tkheyfets / googlemaps-like-pin.html
Last active Mar 23, 2016
GoogleMaps like Pin with only css and html
View googlemaps-like-pin.html
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width" />
<title>Google Maps like Pin</title>
<link type="text/css" rel="stylesheet" href="pin.css" />
View oop.js
function extend(Child, Parent) {
Child.prototype = Object.create(Parent.prototype);
Child.prototype.constructor = Child;
return Child;
var Message = function (text) {
this.text = text;
View text-overflow.css
.text-overflowed {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
View xhr_promise.js
function get(url) {
return new Promise(function(resolve, reject) {
var xhr = new XMLHttpRequest();'GET', url);
xhr.onload = function() {
if (xhr.status === 200) {
} else {
You can’t perform that action at this time.