Skip to content

Instantly share code, notes, and snippets.

@sniok
sniok / index.html
Created August 15, 2018 10:10
Live planes – Mapbox custom layer
<!DOCTYPE html>
<html>
<head>
<title>Custom Layer Demo – Live Planes</title>
<meta charset='utf-8'>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<link rel='stylesheet' href='mapbox-gl.css' />
<style>
body {
{
"users": [
{
"name": "Billie Palm",
"gender": "male",
"photo_url":
"https://www.fakepersongenerator.com/Face/male/male108414886914.jpg",
"integrations": {
"twitter": ["Obama", "Dan Abramov", "Metallica", "prequel memes"],
"facebook": ["Sailing"],
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<!-- saved from url=(0027)http://localhost:9966/bench -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Mapbox GL JS Benchmarks</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="./Mapbox GL JS Benchmarks_files/base.css" rel="stylesheet">
<link rel="stylesheet" href="./Mapbox GL JS Benchmarks_files/mapbox-gl.css">
var someVar = 123456;
// Bad
for(var i = 0; i < someVar*someVar; i++) {}
// Good
var length = someVar*someVar
for(var i = 0; i < length; i++) {}
var a = 10;
// Two comparisons
if( a > 0 && a < 512 ){}
// Binary operations
if( ~a & 512 ) {}
var data = new ImageData(512, 512);
var pixData = data.data;
for (var i = 0; i < PARTICLES_COUNT; ++i) {
// write pixels
}
@sniok
sniok / axis.tree.json
Created January 24, 2017 16:40
Example
// 33/33/33 - is default color. Should be gray
{
"all": {
"rgb": "127/63/124",
"x.r": {
"los": "100",
"material_id": "1",
"oshader": "plastic",
"region": "R",
"region_id": "1000",
@sniok
sniok / g-to-obj.js
Last active September 1, 2016 16:34
// Converts G to OBJ with colors
//
// # Config
//
// file - Name of g file without .g
// g2asc - Path to g2asc command
// g2obj - Path to g-obj command
// mged - Path to mged command
// TODO: Replace with just path to brlcad/bin

Work Product "BRL-CAD Web Infrastructure Update"

This GSoC I worked on updating web infrastructure of BRL-CAD. I made a wordpress website that will replace current landing page and drupal website and add blog feature. I also made theme for MediaWiki that follows visual style of main website to create smooth and continuous user experience. I was following Material Design guidelines and was using Materializecss framework.
What's not done:
Once wordpress site goes live we can remove pages which I mentioned in 'Update BRL-CAD Documentation' section in project plan.

My commits are here:
https://github.com/sniok/web/commits/gsoc2016
Development logs are here:
https://blog.esde.name/
Project plan is here: