An example showing an isometric rendering in SVG, thanks to three.js.
The example is inspired by this post on using three.js to generate illustrations for scientific papers.
// This code is based on https://en.wikipedia.org/wiki/HSL_and_HSV | |
// Free to use for any purpose. No attribution needed. | |
function rgbToHsl(r, g, b) { | |
r /= 255; g /= 255; b /= 255; | |
let max = Math.max(r, g, b); | |
let min = Math.min(r, g, b); | |
let d = max - min; | |
let h; | |
if (d === 0) h = 0; |
<!DOCTYPE html> | |
<html prefix="og: http://ogp.me/ns#"> | |
<head> | |
<!-- content-type, which overrides http equivalent header. Because of charset, this meta should be set at first. --> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | |
<!-- Overrides http equivalent header. This tells IE to use the most updated engine. --> | |
<meta http-equiv="X-UA-Compatible" content="IE=Edge"> | |
<!-- Tells crawlers how to crawl this page, and the role of this page. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta --> | |
<meta name="robots" content="index, follow"> |
# Based on: http://donpottinger.net/blog/2014/11/17/bye-bye-heroku-hello-dokku.html | |
# Add to gemfile: | |
ruby '2.1.2' | |
gem 'pg' | |
gem 'puma' | |
gem 'rails_12factor' | |
gem 'searchkick' | |
gem 'typhoeus' |
/* | |
* 0x1ad2 base Gulp.js file | |
* https://twitter.com/0x1ad2 | |
*/ | |
/* | |
* Define plugins | |
*/ | |
var gulp = require('gulp'); | |
var $ = require('gulp-load-plugins')(); |
require 'net/http' | |
require 'json' | |
require 'uri' | |
@token = '' | |
def list_files | |
ts_to = (Time.now - 30 * 24 * 60 * 60).to_i # 30 days ago | |
params = { | |
token: @token, |
# Based on: http://donpottinger.net/blog/2014/11/17/bye-bye-heroku-hello-dokku.html | |
# Add to gemfile: | |
ruby '2.1.2' | |
gem 'pg' | |
gem 'puma' | |
gem 'rails_12factor' | |
gem 'searchkick' | |
gem 'typhoeus' |
/** | |
* 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 |
#!/usr/bin/env ruby | |
=begin | |
Vimeo Downloader v1.0 by Jaroslaw Zabiello (http://zabiello.com) | |
based on http://cl.ly/2T1x180I251j301L1C3r/vimeo_downloader.sh | |
found thanks to http://goo.gl/AN5sf :) | |
Requirements: | |
* Ruby 1.8 or newer | |
* nokogiri (http://nokogiri.org) |
$('#glass').mousedown(function(evt){ | |
var $thumb = $('<img src="img/thumbprint.png" class="thumbprint">') | |
.css({top:evt.offsetY-30, left:evt.offsetX-20, opacity:1, rotation:90}) //, "-webkit-transform": "rotate("+((Math.random()*30)-15)+" deg)" | |
.delay(1000) | |
.animate({opacity:0}, 2000, function(){$(this).remove();}); | |
$(this).append($thumb); | |
}); |