Skip to content

Instantly share code, notes, and snippets.

View markuszeller's full-sized avatar
🍪
Eating Cookies

Markus Zeller markuszeller

🍪
Eating Cookies
View GitHub Profile
/**
* Converts an RGB color value to HSL. Conversion formula
* adapted from http://en.wikipedia.org/wiki/HSL_color_space.
* Assumes r, g, and b are contained in the set [0, 255] and
* returns h, s, and l in the set [0, 1].
*
* @param Number r The red color value
* @param Number g The green color value
* @param Number b The blue color value
* @return Array The HSL representation
@markuszeller
markuszeller / easing.js
Created May 13, 2019 12:17 — forked from gre/easing.js
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
// no easing, no acceleration
linear: function (t) { return t },
// accelerating from zero velocity
easeInQuad: function (t) { return t*t },
// decelerating to zero velocity
@markuszeller
markuszeller / understanding-word-vectors.ipynb
Created May 13, 2019 12:21 — forked from aparrish/understanding-word-vectors.ipynb
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@markuszeller
markuszeller / OpenSimplexNoise.java
Created March 7, 2020 14:08 — forked from KdotJPG/OpenSimplex2S.java
Visually axis-decorrelated coherent noise algorithm based on the Simplectic honeycomb.
/*
* OpenSimplex Noise in Java.
* by Kurt Spencer
*
* v1.1 (October 5, 2014)
* - Added 2D and 4D implementations.
* - Proper gradient sets for all dimensions, from a
* dimensionally-generalizable scheme with an actual
* rhyme and reason behind it.
* - Removed default permutation array in favor of
function bytesToSize (bytes) {
if (bytes === 0) return '0 B';
const k = 1024;
const sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
const i = Math.floor(Math.log(bytes) / Math.log(k));
return (bytes / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
}
@markuszeller
markuszeller / Search my gists.md
Created March 9, 2020 11:41 — forked from santisbon/Search my gists.md
How to search gists

Enter this in the search box along with your search terms:

Get all gists from the user santisbon.
user:santisbon

Find all gists with a .yml extension.
extension:yml

Find all gists with HTML files.
language:html

@markuszeller
markuszeller / print_r_reverse.php
Created March 18, 2020 11:13 — forked from simivar/print_r_reverse.php
PHP function to reverse print_r function
<?php
/**
* Matt: core
* Trixor: object handling
* lech: Windows suppport
* simivar: null support
*
* @see http://php.net/manual/en/function.print-r.php
**/
function print_r_reverse($input) {
@markuszeller
markuszeller / 50_lines.pde
Created April 27, 2020 12:35 — forked from u-ndefine/50_lines.pde
Sketch of my generative art, "50 Lines"
float decel(float x) { // as an easing function
return 1-(x-1)*(x-1);
}
void setup() {
background(255);
size(750,750,P2D);
PImage img = loadImage("image.png");
strokeWeight(2);
noFill();
@markuszeller
markuszeller / vpn.md
Last active January 1, 2021 10:09 — forked from joepie91/vpn.md
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
  1. save agnoster-light.zsh-theme to ~/.oh-my-zsh/themes/.
  2. edit ZSH_THEME in ~/.zshrc to agnoster-light
  3. change the color theme of terminal to solarized-light
  4. open a new terminal