Skip to content

Instantly share code, notes, and snippets.

View graphis's full-sized avatar

Zsolt Sándor graphis

View GitHub Profile
OpenSimplexNoise noise;
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
@graphis
graphis / Math.uuid.js
Created November 23, 2020 15:13 — forked from Wind4/Math.uuid.js
/*!
Math.uuid.js (v1.4)
http://www.broofa.com
mailto:[email protected]
Copyright (c) 2010 Robert Kieffer
Dual licensed under the MIT and GPL licenses.
*/
/*
@graphis
graphis / .block
Created November 10, 2020 08:05 — forked from gkhays/.block
Oscillating Sine Wave Rendered with JavaScript
license: cc-by-4.0
@graphis
graphis / resize-debounce.js
Created August 28, 2020 12:32
JavaScript: window resize debouncing #snippet
/* --------------------------------------------
* Detect device orientation
* and trigger changes based on it
--------------------------------------------*/
function updateOrientation() {
// Detect whether device supports orientationchange event, otherwise fall back to the resize event
// Genius solution from http://stackoverflow.com/a/2307936
var supportsOrientationChange = "onorientationchange" in window,
orientationEvent = supportsOrientationChange ? "orientationchange" : "resize",
newAngle, newOrientation;
@graphis
graphis / phpbuild.md
Created July 23, 2020 15:20 — forked from rizalp/phpbuild.md
Minimal Build of PHP 7.4.5, linked with sqlite3 from source on Ubuntu 18.04 And Macos
@graphis
graphis / README.md
Created June 2, 2020 20:08 — forked from addyosmani/README.md
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@graphis
graphis / router-middleware.php
Created May 26, 2020 19:19 — forked from harikt/router-middleware.php
Conduit router middleware example
<?php
require dirname(__DIR__) . '/vendor/autoload.php';
use Phly\Conduit\Middleware;
use Phly\Http\Server;
$app = new Middleware();
$router = new \Aura\Router\Router(
new \Aura\Router\RouteCollection(new \Aura\Router\RouteFactory),
new \Aura\Router\Generator
@graphis
graphis / avr-devenv-install-osx.md
Created May 15, 2018 10:50 — forked from jj1bdx/avr-devenv-install-macos.md
Installing 8bit AVR development kit from macOS HomeBrew and FreeBSD Ports with the optiboot environment

AVR 8bit HomeBrew installation for OS X

#/bin/sh
umask 022
brew tap osx-cross/avr
# removal needed before upgrading
brew remove avr-gcc avr-binutils avr-libc
# avr-libc is now included in avr-gcc
brew install avr-gcc avr-binutils
@graphis
graphis / Zeal60_UnderglowGuidePublic.md
Created April 14, 2018 07:41 — forked from tusing/Zeal60_UnderglowGuidePublic.md
A guide detailing how to enable underglow on the Zeal60 with WS2812 LEDs.

RGB Underglow Strip on the Zeal60: A Guide

A. Connecting the strip

You might find the full PCB image helpful. Ignore the red boxes!

  1. Connect V+ to the receiving end of the thermistor labeled F1; connect GND to the board's GND pin. (Avoid connecting +V to the board's +5V pin - you will likely overload the thermistor, and you will limit your maximum brightness.)
In the next version of iPulse, I'd like to show GPU statistics. Unfortunately, the format
for these statistics is vendor specfic (see the "Performance Statistics" dictionary below.)
In order to cover as many devices as possible, I'd like you to run the following commands
from your Terminal:
$ sysctl hw.model
$ ioreg -r -d 1 -w 0 -c "IOAccelerator"
You can help me read the results by putting them in a code block (triple backticks).