Skip to content

Instantly share code, notes, and snippets.

View denis-shvets's full-sized avatar
👻
Take it Easy

Denis Shvets denis-shvets

👻
Take it Easy
  • Klarna AB
  • Stockholm, Sweden
View GitHub Profile
@denis-shvets
denis-shvets / destructuring-iterables.md
Last active August 25, 2019 08:40
Destructuring iterables

Destructuring iterables

In the previous sections, the destructuring was applied to arrays. But you can destructure any object that implements the iterable protocol.

Many native primitive types and objects are iterable: arrays, strings, typed arrays, sets, and maps.

For example, you can destructure a string to characters:

const str = 'cheese';
@denis-shvets
denis-shvets / Player.jsx
Created April 15, 2019 13:43 — forked from vincentriemer/Player.jsx
Player code for my Apple Music clone
// @flow
import * as React from "react";
import {
View,
StyleSheet,
Image,
Animated,
TouchableOpacity,
Text,
@denis-shvets
denis-shvets / docker.commands
Last active January 14, 2017 01:11
Docker commands
# Build Dockerfile from current path
docker build -t <image_name> .
# Run Docker image
docker run --restart=always --name <instance_name> -dt -p 0.0.0.0:<local-port>:<server-port> <image_name>
# Stop Docker image
docker stop <instance_name>
# Delete all containers
@denis-shvets
denis-shvets / sanfrancisco-font.css
Created February 2, 2016 12:50
San Francisco Web Font
/**
* http://applemusic.tumblr.com/
* https://jsfiddle.net/xq56dmrh/
*/
/** Ultra Light */
@font-face {
font-family: "San Francisco";
font-weight: 100;
src: url("https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-ultralight-webfont.woff");
git tag -d 12345
git push origin :refs/tags/12345
@denis-shvets
denis-shvets / cmd
Created November 14, 2015 17:02
Remove files with long names/paths
mkdir temp
robocopy temp target /s /mir
rmdir temp
rmdir target
var domReady = function(callback) {
if(callback && typeof callback === 'function') {
if(!document.attachEvent || typeof document.attachEvent === 'undefined') {
document.addEventListener('DOMContentLoaded', function() {
return callback();
});
} else {
document.attachEvent('onreadystatechange', function() {
if(document.readyState === 'complete') {
return callback();
@denis-shvets
denis-shvets / no talloc stackframe, leaking memory
Created June 11, 2015 09:24
no talloc stackframe at ../source3/param/loadparm.c:4864, leaking memory
You can also fix this issue while keeping libpam-smbpass installed by running "pam-auth-update" and remove "SMB password synchronization".
@denis-shvets
denis-shvets / CSS: Sticky Footer
Created May 29, 2015 14:59
CSS: Sticky Footer
@denis-shvets
denis-shvets / JS: jQuery plugin
Last active August 29, 2015 14:21
JS: jQuery plugin
;(function($, document, window, undefined) {
'use strict';
var pluginName = 'pluginname';
var instance = 0;
var PluginName = function(el, options, instance) {
this.instance = instance;
this.options = $.extend({}, options);
this.cache = {