Skip to content

Instantly share code, notes, and snippets.

# Video: http://rubyhoedown2008.confreaks.com/08-chris-wanstrath-keynote.html
Hi everyone, I'm Chris Wanstrath.
When Jeremy asked me to come talk, I said yes. Hell yes. Immediately. But
then I took a few moments and thought, Wait, why? Why me? What am I supposed
to say that's interesting? Something about Ruby, perhaps. Maybe the
future of it. The future of something, at least. That sounds
keynote-y.
// Adds a lovely fade in of the modal
// and a gentle slide-down of the modal content
class Demo extends React.Component {
state = { showDialog: false };
render() {
return (
<div>
<button onClick={() => this.setState({ showDialog: true })}>
Show Dialog
</button>
@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,
// 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 / 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
@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 / 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 / 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();
// https://codepen.io/rachsmith/pen/yYZapV
/* HTML
<canvas id="canvas"></canvas>
<h1>Follow the mouse - with lerp</h1>
*/
@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
//