Skip to content

Instantly share code, notes, and snippets.

@kates
kates / unassigned.sh
Created March 17, 2016 03:19
elasticsearch unassigned
curl -X PUT http://localhost:9200/_settings -d '{ "number_of_replicas" :0 }'
curl -X PUT http://localhost:9200/_cluster/settings -d '{"transient" : {"cluster.routing.allocation.enable": true}}'
@kates
kates / mp3tomp4.sh
Created May 13, 2017 15:36
convert mp3 to mp4 with image loop using ffmpeg
ffmpeg -loop 1 -i logo.jpg -i source.mp3 -c:a libmp3lame -c:v libx264 -b:a 128k -shortest output.mp4
@kates
kates / klass.js
Created November 5, 2019 09:14
A tiny JS framework.
var Klass = (function() {
var Klass = function() {};
Klass.extend = function(constructor, props) {
var _super = this.prototype;
if (arguments.length < 2) {
props = constructor;
constructor = function(){};
}
@kates
kates / main.c
Last active July 29, 2021 02:25
Simple IRQ Button Debounce for Raspberry Pi Pico
#include <stdio.h>
#include "hardware/irq.h"
#include "hardware/gpio.h"
#include "pico/stdlib.h"
#include "pico/time.h"
static const uint8_t DEBOUNCE = 50;
static bool pressed = false;
static int32_t alarm_id = 0;