Skip to content

Instantly share code, notes, and snippets.

View KoolKeith's full-sized avatar

KoolKeith

  • GER
View GitHub Profile
@IvanBayan
IvanBayan / flac2mp3.sh
Last active March 6, 2020 08:41
Split flac and encode it to mp3/ogg
#!/bin/bash -x
# Requered tools: cuetools, shntool, id3v2, vorbis-tools, lame
#
LAMEOPTS="-b 320 --quiet"
OGGOPTS="-b 320 --quiet"
usage () {
echo Usage: "$(basename $0)" "-f /path/to.flac -s /path/to.cue -e mp3|ogg"
@barraponto
barraponto / idletime.js
Last active April 3, 2024 11:17
ES6+ event-based browser idle timer.
const DOCUMENT_EVENTS = [
'mousemove', 'mousedown', 'click',
'touchmove', 'touchstart', 'touchend',
'keydown', 'keypress'
];
export class IdleTimer {
constructor(onIdleTimeout, timeout) {
this.onIdleTimeout = onIdleTimeout;
this.timeout = timeout;
@Admicos
Admicos / config.yml
Last active November 18, 2018 05:05
Join Python receiver thingy
port: 1818
commands:
# Join Push Text : Command to run
"eg=:=shutdown": "systemctl poweroff"
#fallback-cmd: "./fallbacktest.sh"
@WeiChiaChang
WeiChiaChang / progress.html
Created July 26, 2017 10:08
Simple Pure CSS Progress Bar
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta chatset="UTF-8" />
<title>CSS Progress Bar</title>
<style>
.wrapper {
width: 500px;
}
@BenjaminFraser
BenjaminFraser / nRF24l01_slave_ackpayload_multiple.cpp
Created June 27, 2017 21:33
A slave device program that can be installed on up to 6 remote slave devices using the nRF24l01+ transceiver and TMRh20 RF24 library.
/*************************************************************************
* Remote node - nRF24L01+ radio communications *
* A program to operate a remote-node slave device that sends *
* data to a command unit on a given request message. The radio *
* transceiver used is the nRF24L01+, and it operates using the *
* TMRh20 RF24 library. *
* *
* Author: B.D. Fraser *
* *
* Last modified: 27/06/2017 *
@imdkm
imdkm / GeniusMetaData.py
Last active February 15, 2024 20:17
getting every song's meta data from a certain artist with Genius API
# this code is inspired by Jon Evans' project.
# http://www.jw.pe/blog/post/quantifying-sufjan-stevens-with-the-genius-api-and-nltk/
import requests, json
from time import sleep
# constant values.
BASE_URL = "https://api.genius.com"
CLIENT_ACCESS_TOKEN = "<YOUR TOKEN HERE>"
ARTIST_NAME = "<ANY ARTIST NAME>"
@qawemlilo
qawemlilo / pagination.md
Created February 2, 2016 06:58 — forked from mislav/pagination.md
"Pagination 101" by Faruk Ateş

Pagination 101

Article by Faruk Ateş, [originally on KuraFire.net][original] which is currently down

One of the most commonly overlooked and under-refined elements of a website is its pagination controls. In many cases, these are treated as an afterthought. I rarely come across a website that has decent pagination, and it always makes me wonder why so few manage to get it right. After all, I'd say that pagination is pretty easy to get right. Alas, that doesn't seem the case, so after encouragement from Chris Messina on Flickr I decided to write my Pagination 101, hopefully it'll give you some clues as to what makes good pagination.

Before going into analyzing good and bad pagination, I want to explain just what I consider to be pagination: Pagination is any kind of control system that lets the user browse through pages of search results, archives, or any other kind of continued content. Search results are the o

@alexpchin
alexpchin / socket-cheatsheet.js
Created December 15, 2015 16:58
A quick cheatsheet for socket.io
// sending to sender-client only
socket.emit('message', "this is a test");
// sending to all clients, include sender
io.emit('message', "this is a test");
// sending to all clients except sender
socket.broadcast.emit('message', "this is a test");
// sending to all clients in 'game' room(channel) except sender
@Mottie
Mottie / README.md
Last active August 16, 2017 19:46

Testing Chrome Extension

This code is meant to supplement this Stackoverflow question: http://stackoverflow.com/q/32288996/145346

To use:

  • Download these files into a folder.
  • Open up Chrome extensions: chrome://extensions/
  • Click on the "Developer mode" checkbox at the top
  • Click on "Load unpacked extension..."
@ajfisher
ajfisher / 0x00000.bin
Last active October 10, 2021 00:51
ESP8266 Transparent bridge to J5