This file contains hidden or 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
| // Set a high fidelity for smooth curves (default is 32) | |
| $fn = 64; | |
| // Global radius for the face structure | |
| radius = 50; | |
| module spiral_2d(radius_max = 20, turns = 4, line_width = 2) { | |
| // We sample points densely for a smooth hull | |
| num_segments = turns * $fn; | |
| radius_step = radius_max / num_segments; |
This file contains hidden or 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
| radius = 50; | |
| module smile(){ | |
| difference(){ | |
| translate([0, 0, 0]) | |
| circle(radius); | |
| translate([0, 40, 0]) | |
| circle(radius+15); | |
| } | |
| } |
This file contains hidden or 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
| radius = 50; | |
| module smile(){ | |
| difference(){ | |
| translate([0, 0, 0]) | |
| circle(radius); | |
| translate([0, 40, 0]) | |
| circle(radius+15); | |
| } | |
| } |
This file contains hidden or 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
| body, img, video {filter: invert(100%) hue-rotate(180deg);} |
This file contains hidden or 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
| <body bgcolor=black> | |
| <canvas id='canvas1' width='1024' height='720'> | |
| </canvas> | |
| <button onclick="progress=Math.max(0.0,progress-0.1)"><</button> | |
| <button onclick="progress=Math.min(1.0,progress+0.1)">></button> | |
| </body> | |
| <script id="vs" type="x-shader/x-vertex"> | |
| attribute vec3 aPosition; | |
| varying vec3 vPosition; |
This file contains hidden or 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
| { // must be inside our own scope here so that when we are unloaded everything disappears | |
| // we also define functions using 'let fn = function() {..}' for the same reason. function decls are global | |
| let drawTimeout; | |
| // Actually draw the watch face | |
| let draw = function() { | |
| var x = g.getWidth() / 2; | |
| var y = g.getHeight() / 2; | |
| g.reset().clearRect(Bangle.appRect); // clear whole background (w/o widgets) | |
| g.setColor(0.2,0.2,1); |
This file contains hidden or 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 approximate_pi = n => { | |
| let pi = 0 | |
| let denom = 1 | |
| for(let i = 0;i<n;i++){ | |
| pi += (i%2?-4:4)/denom | |
| denom += 2 | |
| } | |
| return pi | |
| } |
This file contains hidden or 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 circDepReplacer(k,v){return k&&v==this?null:v} | |
| // used like JSON.stringify(obj,circDepReplacer) | |
| // only replaces references to main object, not sub-objects |
This file contains hidden or 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
| #!/bin/bash | |
| function pair(){ | |
| osascript <<'END' | |
| use framework "IOBluetooth" | |
| use scripting additions | |
| set blueToothDevice to "Buds Pro" | |
| on getFirstMatchingDevice(deviceName) |
This file contains hidden or 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 getBytes = (bytes,{unit=null,binary=false,toFixed=1} = {}) => { | |
| const divisor = binary?1024:1000; | |
| let value = bytes; | |
| let sizeLevel=-1; | |
| const sizeArray=['KB','MB','GB','TB','PB']; | |
| if(unit){ | |
| sizeLevel=sizeArray.indexOf(unit); | |
| value=(bytes/Math.pow(divisor,sizeLevel+1)).toFixed(toFixed) | |
| } | |
| else while(value>=divisor){ |
NewerOlder