Skip to content

Instantly share code, notes, and snippets.

@gapurov
gapurov / setup_tmux_zsh.sh
Last active December 20, 2017 08:21 — forked from stvhwrd/setup_tmux_zsh.sh
Install tmux and zsh on a remote server without root
#!/usr/bin/env bash
# Connect to the server..
# ssh username@server_ip
mkdir ~/.local;
# Download source and build libevent
cd /tmp;
wget https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz;
tar xvfz libevent-2.1.8-stable.tar.gz;
@gapurov
gapurov / index-0-non-debounced.js
Last active February 11, 2018 14:22 — forked from elijahmanor/index-0-non-debounced.js
React Debouncing Events
import React, { Component } from "react";
import { render } from "react-dom";
import "./index.css";
class Widget extends Component {
state = { text: "" };
handleChange = (e) => {
this.setState({ text: e.target.value });
};
render() {
@gapurov
gapurov / scrollTo.js
Created February 26, 2018 14:01 — forked from joshcanhelp/scrollTo.js
Animated scrollTo for specific element or top of page
//
// Smooth scroll-to inspired by:
// http://stackoverflow.com/a/24559613/728480
//
module.exports = function (scrollTo, scrollDuration) {
//
// Set a default for where we're scrolling to
//
// https://codepen.io/rachsmith/pen/yYZapV
/* HTML
<canvas id="canvas"></canvas>
<h1>Follow the mouse - with lerp</h1>
*/
@gapurov
gapurov / mouseOverComponent.tsx
Created March 18, 2018 14:12 — forked from mikebridge/mouseOverComponent.tsx
listen to react mouseover events with rxjs
class MouseOverComponent extends React.Component {
componentDidMount() {
this.mouseMove$ = Rx.Observable.fromEvent(this.mouseDiv, "mousemove")
.throttleTime(1000)
.subscribe(() => console.log("throttled mouse move"));
}
componentWillUnmount() {
this.mouseMove$.unsubscribe();
@gapurov
gapurov / README.md
Created April 26, 2018 14:35 — forked from pbojinov/README.md
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe

@gapurov
gapurov / Python3 Virtualenv Setup.md
Created May 10, 2018 14:41 — forked from pandafulmanda/Python3 Virtualenv Setup.md
Setting up and using Python3 Virtualenv on Mac

Python3 Virtualenv Setup

Requirements
  • Python 3
  • Pip 3
$ brew install python3
@gapurov
gapurov / gist:194f424971b69fd1cf5659a550eae1b1
Created May 22, 2018 18:11 — forked from kylefox/gist:4512777
If you want to use Xcode's FileMerge as your git mergetool, this is how you set it up.
# Tell system when Xcode utilities live:
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
# Set "opendiff" as the default mergetool globally:
git config --global merge.tool opendiff
// finished version of https://youtu.be/yIcve5wIuAg
function add(...args) {
function curriedAdd(...args2) {
return add(...args, ...args2)
}
curriedAdd.value = args.reduce((total, current) => total + current)
return curriedAdd
}
@gapurov
gapurov / YouTubeMusic.bsstrategy
Last active October 2, 2020 11:08
BeardedSpice Youtube and Youtube Music Media Strategies
//
// YouTubeMusic.plist
// BeardedSpice
//
// Created by Vladislav Gapurov on 07/28/18
// Copyright (c) 2013 Tyler Rhodes / Jose Falcon. All rights reserved.
//
BSStrategy = {
version: 1,