Skip to content

Instantly share code, notes, and snippets.

View IkarosKappler's full-sized avatar
💭
I want to build a submarine one day.

Ikaros Kappler IkarosKappler

💭
I want to build a submarine one day.
View GitHub Profile
@IkarosKappler
IkarosKappler / blink.py
Created November 3, 2014 21:03
A test script to let an LED blink on your RaspberryPi (pin 11).
@IkarosKappler
IkarosKappler / function.createHumanReadableTimestamp.js
Created December 24, 2014 22:27
This function creates a human-readable date/time string. Format: YYYY-MM-DD_H.i.s
/**
* @author Ikaros Kappler
* @date 2014-12-24
* @version 1.0.0
**/
/**
* This function creates a human-readable date/time string.
* Format: YYYY-MM-DD_H.i.s
**/
@IkarosKappler
IkarosKappler / README.md
Last active February 16, 2022 17:55
SVG path to Three.js shape
@IkarosKappler
IkarosKappler / complex.class.js
Last active May 31, 2017 00:27
A simple and minimal javascript class for complex number arithmetic (does not support SQRT yet).
/**
* A complex math class in rectangular coordinates.
*
* @author Ikaros Kappler
* @date 2017-05-03
* @modified 2017-05-30 Fixed wrong named 'div' function ('sub' duplicates).
* @version 1.0.1
**/
var Complex = (function() {
@IkarosKappler
IkarosKappler / Graph.class.js
Created May 31, 2017 22:38
A very simple Javascript graph/relation class for storing connecting nodes data.
/**
* A simple graph class.
*
* @author Ikaros Kappler
* @date 2017-05-30
* @modified 2017-05-31 Fixed the 'undirected' param and the getConnected function.
* @version 1.0.1
**/
var Graph = (function() {
@IkarosKappler
IkarosKappler / webaudio.polyfill.js
Created November 15, 2017 16:23
WebAudio API Polyfill for Safari Browsers
/**
* Safari does handle web audio a bit different.
*
* Original found at
* https://gist.github.com/laziel/7aefabe99ee57b16081c
*
* Modified by Ikaros Kappler
* @date 2017-11-15
**/
@IkarosKappler
IkarosKappler / site-config
Created December 4, 2017 19:09
Configuration | Nginx user_dir public_html with PHP execution (+fastCGI)
server {
listen 80;
listen [::]:80 default_server ipv6only=on;
server_name _;
root /usr/share/nginx/www;
index index.php index.html index.htm;
# Deny access to all dotfiles
location ~ /\. {
@IkarosKappler
IkarosKappler / MouseHandler.js
Created April 2, 2018 14:35
A simple javascript mouse handler.
/**
* A simple mouse handler for demos.
* Use to avoid load massive libraries like jQuery.
*
* Usage:
* new MouseHandler( document.getElementById('mycanvas') )
* .drag( function(e) {
* console.log( 'Mouse dragged: ' + JSON.stringify(e) );
* if( e.params.leftMouse ) ;
* else if( e.params.rightMouse ) ;
@IkarosKappler
IkarosKappler / bbtree.js
Last active December 19, 2018 19:41
A simple balanced binary search tree implemenation (based on https://github.com/mourner/bbtree)
/**
* A simple balanced binary search-tree class I adapted from an implementation
* by https://github.com/mourner.
*
*
* Original implementation (basically a demo/test class) found at
* https://github.com/mourner/bbtree
*
*
* I just added a closure and a utility function to iterate over the set.
@IkarosKappler
IkarosKappler / bash_confirm_yes_no.sh
Created December 18, 2019 23:13
A bash snippet to request a Y/N confirmation from the user.
#!/bin/bash
while true; do
read -p "Do you really wish to do this thing? (y/n)? " yn
case $yn in
[Yy]* ) echo "Doing the thing now."; break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done