Skip to content

Instantly share code, notes, and snippets.

@yuijim
yuijim / renderers_arg.py
Last active November 1, 2021 09:39
Argparse + Enum + multiple choice
from enum import Enum
import argparse
class Renderers(Enum):
source_videos = 0 # values can be anything you need, e.g. specific Renderer classes / objects
input_points = 1
projection_points = 2
parser = argparse.ArgumentParser()
parser.add_argument(
@yuijim
yuijim / simple-slider.js
Created June 5, 2018 09:36
Very simple (and not-quite-complete) slider
export default class SimpleSlider {
constructor(container, options) {
this.options = options;
this.autoInterval = options.auto;
this.visible = options.visible;
this.classes = options.classes;
this.selectors = options.selectors;
this.container = container;
@yuijim
yuijim / fade-toggle.less
Last active August 29, 2015 14:00
Example of how to pass selectors to a mixin in LESS
.fade-toggle (@openSelector: ~'.open'; @inTransitionClassName: ~'transition-helper'; @openRight: 0; @zIndex: 1) {
.transition(opacity .25s ease-in-out);
position: absolute;
left: -9999em;
z-index: @zIndex;
opacity: 0;
@rls: {
left: 0;
right: @openRight;