This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
item= { type: 'node', | |
id: 26544677, | |
lat: 31.214043300000004, | |
lon: 29.8856965, | |
tags: | |
{ name: 'ﻢﻧﺍﺭﺓ ﺍﻺﺴﻜﻧﺩﺮﻳﺓ', | |
'name:en': 'Lighthouse of Alexandria', | |
tourism: 'attraction', | |
wikidata: 'Q43244', | |
wikipedia: 'en:Lighthouse of Alexandria' }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var xhr = require('xhr') | |
var decode = require('../decode.js') | |
var buffers = [] | |
xhr.get('./alexbufarr', function(err, resp) { //input filename is hardcoded here | |
resp.body.split('\n').forEach(function(line){ | |
if (line.length != 0){ | |
buffers.push(Buffer.from(line, 'base64')) | |
} | |
else return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find the appropriate file for your system on https://nodejs.org/en/download/ | |
(if you're not sure whether you should use 32-bit or 64-bit, follow instructions here: https://www.computerhope.com/issues/ch001121.htm) | |
copy the link to the appropriate file. in the example below we're using the link for the Linux 64-bit binary. if you're using a different file, substitute as necessary. | |
on the command line, do the following series of commands one at a time: | |
cd /tmp | |
wget https://nodejs.org/dist/v6.10.3/node-v6.10.3-linux-x64.tar.xz | |
tar -xf node-v6.10.3-linux-x64.tar.xz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
download appropriate file from https://nodejs.org/en/download/ | |
`tar -xf /name/of/file.tar.gz -C /usr/local/` | |
`export PATH=$PATH:node_dir/bin` | |
if in ubuntu: `sudo ln -s "$(which nodejs)" /usr/bin/node` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function colors (onclick) { | |
var pkeys = Object.keys(state.paletteMap) | |
var prows = [] | |
for (var i = 0; i < pkeys.length; i += 10) { | |
prows.push(pkeys.slice(i,i+10)) | |
} | |
return html`<div class="colors"> | |
${prows.map(function (row) { | |
return html`<div> | |
${row.map(function (src) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (prows) { | |
var phex = pals[state.palette].hex | |
for (var i = 0; i < phex.length; i += 10) { | |
prows.push(phex.slice(i,i+10)) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const regl = require('regl')() | |
const vectorizeText = require('vectorize-text') | |
const mat4 = require('gl-mat4') | |
const glsl = require('glslify') | |
const textMesh = vectorizeText('thank you pauline oliveros', { | |
triangles: true, | |
width: 5, | |
textAlign: 'center', | |
textBaseline: 'middle' | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function (regl){ | |
const drawcyl = regl({ | |
frag: ` | |
precision mediump float; | |
varying vec3 vnormal; | |
vec3 hsl2rgb(vec3 hsl) { | |
vec3 rgb = clamp( abs(mod(hsl.x*5.0+vec3(0.0,4.0,2.0),6.0)-3.0)-1.0, 0.0, 1.0 ); | |
return hsl.z - hsl.y * (rgb-0.5)*(3.0-abs(2.0*hsl.y-1.0)); | |
} | |
void main () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mesh = isosurface.surfaceNets([26,26,26], | |
function sdTorus(a, b) //a should be a vec3, b should be a vec2 | |
{ | |
c = [glvec2.length([a[0], a[2]])-b[0],a[1]]; | |
return glvec2.length(c)-a[1]; | |
}, [[-11,-11,-11], [11,11,11]]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
marina@lilserve:~$ top | |
top - 18:05:25 up 40 days, 14:29, 1 user, load average: 0.02, 0.27, 0.21 | |
Tasks: 78 total, 1 running, 77 sleeping, 0 stopped, 0 zombie | |
%Cpu(s): 0.0 us, 0.0 sy, 0.0 ni,100.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st | |
KiB Mem: 501792 total, 487360 used, 14432 free, 5188 buffers | |
KiB Swap: 1048572 total, 40 used, 1048532 free. 78992 cached Mem | |
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND | |
2340 marina 20 0 24816 1520 1112 R 0.3 0.3 0:00.03 top |
NewerOlder