Skip to content

Instantly share code, notes, and snippets.

@sosukeinu
sosukeinu / ffserver.conf
Created May 1, 2019 20:09 — forked from peterhellberg/ffserver.conf
MJPEG stream from Webcam using FFServer and FFMpeg
HTTPPort 8090
HTTPBindAddress 0.0.0.0
MaxHTTPConnections 200
MaxClients 100
MaxBandWidth 500000
CustomLog -
<Feed camera.ffm>
File /tmp/camera.ffm
FileMaxSize 200M
@sosukeinu
sosukeinu / check-component.js
Created April 11, 2019 18:52 — forked from honzabilek4/check-component.js
Vue check if component exist
checkIfComponentExists() {
const keys = Object.keys(this.$options.components);
const names = keys.map(key => {
const component = this.$options.components[key];
let name = '';
if (component) {
name = component.name;
}
return name;
});
@sosukeinu
sosukeinu / rgb.txt
Created November 2, 2018 16:10 — forked from dco-lentz/rgb.txt
solarized rgb
SOLARIZED HEX 16/8 TERMCOL XTERM/HEX L*A*B RGB HSB
--------- ------- ---- ------- ----------- ---------- ----------- -----------
base03 #002b36 8/4 brblack 234 #1c1c1c 15 -12 -12 0 43 54 193 100 21
base02 #073642 0/4 black 235 #262626 20 -12 -12 7 54 66 192 90 26
base01 #586e75 10/7 brgreen 240 #585858 45 -07 -07 88 110 117 194 25 46
base00 #657b83 11/7 bryellow 241 #626262 50 -07 -07 101 123 131 195 23 51
base0 #839496 12/6 brblue 244 #808080 60 -06 -03 131 148 150 186 13 59
base1 #93a1a1 14/4 brcyan 245 #8a8a8a 65 -05 -02 147 161 161 180 9 63
base2 #eee8d5 7/7 white 254 #e4e4e4 92 -00 10 238 232 213 44 11 93
base3 #fdf6e3 15/7 brwhite 230 #ffffd7 97 00 10 253 246 227 44 10 99
@sosukeinu
sosukeinu / Makefile
Created October 22, 2018 15:05 — forked from mpneuried/Makefile
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
@sosukeinu
sosukeinu / alpine-jre-8
Created October 10, 2018 19:01 — forked from rhuss/alpine-jre-8
The Holy Grail of a Minimal, Headless, OpenJDK JRE 8
# Build for 206 MB JRE 1.8.0_60 (192 MB in size) with Alping and glibc
FROM alpine:3.2
ENV JRE=jre1.8.0_60 \
JAVA_HOME=/opt/jre
# That's the an EA from OpenJDK.net
# Courtesy to https://github.com/frol/docker-alpine-oraclejdk8 from where the setup of glibc is borrowed
@sosukeinu
sosukeinu / redis_cheatsheet.bash
Created October 10, 2018 15:41 — forked from LeCoupa/redis_cheatsheet.bash
Redis Cheatsheet - Basic Commands You Must Know --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
# Redis Cheatsheet
# All the commands you need to know
redis-server /path/redis.conf # start redis with the related configuration file
redis-cli # opens a redis prompt
# Strings.
@sosukeinu
sosukeinu / rate_limit.js
Created July 19, 2018 19:55 — forked from mattheworiordan/rate_limit.js
Rate limiting function calls with JavaScript and Underscore.js
/* Extend the Underscore object with the following methods */
// Rate limit ensures a function is never called more than every [rate]ms
// Unlike underscore's _.throttle function, function calls are queued so that
// requests are never lost and simply deferred until some other time
//
// Parameters
// * func - function to rate limit
// * rate - minimum time to wait between function calls
// * async - if async is true, we won't wait (rate) for the function to complete before queueing the next request
@sosukeinu
sosukeinu / debounce.py
Created July 19, 2018 15:37 — forked from walkermatt/debounce.py
A debounce function decorator in Python similar to the one in underscore.js, tested with 2.7
from threading import Timer
def debounce(wait):
""" Decorator that will postpone a functions
execution until after wait seconds
have elapsed since the last time it was invoked. """
def decorator(fn):
def debounced(*args, **kwargs):
def call_it():
@sosukeinu
sosukeinu / debounce.py
Created July 13, 2018 21:03 — forked from kylebebak/debounce.py
Simple Python 3 debounce implementation
"""
@debounce(3)
def hi(name):
print('hi {}'.format(name))
hi('dude')
time.sleep(1)
hi('mike')
time.sleep(1)
@sosukeinu
sosukeinu / dust.py
Created January 22, 2018 14:32 — forked from anfederico/dust.py
Get rid of dust on your Binance account
# pip install python-binance
from binance.client import Client
client = Client(api_key, api_secret)
DUST = 0.001 # BTC
account = client.get_account()
prices = client.get_all_tickers()