float rand(float n){return fract(sin(n) * 43758.5453123);}
float noise(float p){
float fl = floor(p);
float fc = fract(p);
return mix(rand(fl), rand(fl + 1.0), fc);
}
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
| <style type="text/css"> | |
| .tg {border-collapse:collapse;border-spacing:0;} | |
| .tg td{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px; | |
| overflow:hidden;padding:10px 5px;word-break:normal;} | |
| .tg th{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px; | |
| font-weight:normal;overflow:hidden;padding:10px 5px;word-break:normal;} | |
| .tg .tg-baqh{text-align:center;vertical-align:top} | |
| </style> | |
| <table class="tg"> | |
| <thead> |
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
| if(label == "Start"){ | |
| flippedVideo.loadPixels(); | |
| noStroke(); | |
| for (let y = 0; y < flippedVideo.height; y += 8) { | |
| for (let x = 0; x < flippedVideo.width; x += 8) { | |
| let offset = ((y*flippedVideo.width)+x)*4; | |
| fill(flippedVideo.pixels[offset], | |
| flippedVideo.pixels[offset+1], | |
| flippedVideo.pixels[offset+2]); | |
| rect(x, y, 8, 8); |
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
| { | |
| email: "[email protected]" | |
| } |
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
| { | |
| email: "[email protected]" | |
| } |
Here is a script that can be run with canvas-sketch to generate OBJ files from a parametric/algorithmic 3D ThreeJS geometry.
Hitting "Cmd + S" from the canvas-sketch tool will export a PNG and OBJ file of the scene.
If the same script is run from Node, it will simply render the OBJ to stdout, or write to the filename argument if given.
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
| # --------------------------------------------------------------------------- | |
| # | |
| # Description: This file holds all my BASH configurations and aliases | |
| # | |
| # Sections: | |
| # 1. Environment Configuration | |
| # 2. Make Terminal Better (remapping defaults and adding functionality) | |
| # 3. File and Folder Management | |
| # 4. Searching | |
| # 5. Process Management |
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 playVideoOnClick (selector) { | |
| el = document.querySelector(selector); | |
| if (el) { | |
| addListener(); | |
| } else { | |
| window.addEventListener('load', addListener); | |
| } | |
| function addListener () { |
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
| // taken from https://github.com/arduino/Arduino/issues/3934 | |
| // its an alternative to: https://www.arduino.cc/en/Tutorial/Smoothing | |
| const int filterWeight = 4; // higher numbers = heavier filtering | |
| const int numReadings = 10; | |
| int average = 0; // the average | |
| void setup() { | |
| // initialize serial communication with computer: |
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
| var json2csv = require('json2csv'); | |
| var jsonfile = require('jsonfile'); | |
| var fs = require('fs'); | |
| var fields = ['Body', 'DateCreated', 'timestamp']; | |
| var file = './jsontest_edit.json'; | |
| var import_json = ""; | |
| jsonfile.readFile(file, function(err, obj) { | |
| console.dir(obj); | |
| import_json = obj; |