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 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 tag = document.createElement('script'); | |
tag.src = "//www.youtube.com/iframe_api"; | |
var firstScriptTag = document.getElementsByTagName('script')[0]; | |
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); | |
var player; | |
function onYouTubeIframeAPIReady() { | |
player = new YT.Player('player', { | |
height: '254', | |
width: '451', |
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 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
<!--Example JS template--> | |
<script type="text/template" id="PastCommunityTemplate"> | |
<img class="pvs-cmy-img" src="<%= thumbnail %>" alt="<%= name %>"> | |
<h3 class="pvs-cmy-title"><%= name %></h3> | |
<h4 class="pvs-cmy-city">City: <%= city %></h4> | |
<p class="pvs-cmy-description"><%= summary %></p> | |
</script> |
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
# GIT | |
alias gs='git status' | |
alias gpl='git pull' | |
alias gc='git commit' | |
alias gp='git push' | |
alias ga='git add' | |
# GRUNT | |
alias gw='grunt watch --force' | |
alias gb='grunt build --force' |
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
// 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 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; |
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
# Header 1 # | |
## Header 2 ## | |
### Header 3 ### (Hashes on right are optional) | |
#### Header 4 #### | |
##### Header 5 ##### | |
## Markdown plus h2 with a custom ID ## {#id-goes-here} | |
[Link back to H2](#id-goes-here) | |
This is a paragraph, which is text surrounded by whitespace. Paragraphs can be on one |
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
Grep | |
========== | |
grep -ir "some_string" some_directory | |
grep -ir --include=*.less "some_string" some_directory |