Skip to content

Instantly share code, notes, and snippets.

View mystroken's full-sized avatar
🍊

Mystro Ken mystroken

🍊
View GitHub Profile
/**
* Returns the list of distinctive
* elements based on current relations.
* @param items
* @param relations
* @returns string[]
*/
function getDistinctiveItemsFromRelations(
items: Record<string, { type: string }>,
relations: Record<string, string[]>
var cameraZ = camera.position.z;
var planeZ = 5;
var distance = cameraZ - planeZ;
var aspect = viewWidth / viewHeight;
var vFov = camera.fov * Math.PI / 180;
var planeHeightAtDistance = 2 * Math.tan(vFov / 2) * distance;
var planeWidthAtDistance = planeHeightAtDistance * aspect;
// or
@mystroken
mystroken / Download Google Drive file with WGET
Created July 30, 2019 12:42
Download Google Drive file with WGET
wget --no-check-certificate -r 'https://docs.google.com/uc?export=download&confirm=&id=FILEID' -O FILENAME
@mystroken
mystroken / webgl-useful-links
Last active March 26, 2019 13:10
Links to tutorials or examples that learn something nice on WebGL
@mystroken
mystroken / article-item-list.html
Last active November 8, 2021 19:37
Structured Data Markups using Microdata - https://schema.org
<article role="article" itemid="http://example.com/article-1" itemscope itemtype="http://schema.org/BlogPosting">
<link itemprop="mainEntityOfPage" href="http://example.com/article-1" />
<h2 itemprop="headline">
<a itemprop="url" href="#" title="">Article title</a>
Coming this April, HBO NOW will be available exclusively in the U.S. on Apple TV and the App Store.
</h2>
<img itemprop="image" src="http://images.apple.com/live/2015-mar-event/images/573cb_xlarge_2x.jpg">
<p>
Published by <cite itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Mystro Ken</span></cite>
<time itemprop="datePublished" datetime="2015-03-09T13:08:00-07:00">March 9, 2015 1:08PM</time>
/**
* Created by ken on 09/08/2017.
*/
var gulp = require("gulp"),
sass = require("gulp-sass"),
autoprefixer = require('gulp-autoprefixer'),
uglify = require('gulp-uglify'),
minifycss = require('gulp-minify-css'),
sourcemaps = require('gulp-sourcemaps'),
httrack https://material.google.com \
+https://material-design.storage.googleapis.com/* \
+https://fonts.googleapis.com/* \
+https://fonts.gstatic.com/* \
+https://www.googletamanager.com/* --verbose
# First I've to create the destination directory
cd ~/Documents
mkdir material-offline-website && cd material-offline-website/
# Then fire httrack
httrack https://material.google.com
@mystroken
mystroken / 0_reuse_code.js
Created August 22, 2016 10:39
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console