Skip to content

Instantly share code, notes, and snippets.

View belozer's full-sized avatar
🏠
Working from home

Sergey Belozyorcev belozer

🏠
Working from home
View GitHub Profile
@jaxxreal
jaxxreal / useCarousel.ts
Created November 22, 2019 05:28
Carousel hook with gestures support
import * as React from 'react';
const { default: TinyGesture } = require('tinygesture');
export function useCarousel(itemsLength: number) {
const [state, setState] = React.useState({ currentIndex: 0, translateValue: 0 });
const carouselRef = React.useRef<HTMLDivElement>(null);
React.useEffect(() => {
const gesture = new TinyGesture(carouselRef.current);
@andyl
andyl / extension.js
Last active December 13, 2018 11:25
const vscode = require('vscode');
const shelljs = require('shelljs');
// This extension is a hack to explore a possible VsCode way to search
// for a directory name.
//
// In IntelliJ you can search for a directory by ending the search string with '/'.
// In Vim, you can `:call fzf#run({'source': 'fd -t d', 'sink': 'NERDTreeFind'})`
//
// But VsCode doesn't seem to provide an API to open the current