"""scala // Basic Syntax object ScalaNotes { def main(args: Array[String]) { println("Hello, World!") // prints hello world } } """
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
| def random_color(code="hex") | |
| rgb = [] | |
| # generate 3 random color values | |
| 3.times {rgb << (rand() * 255).floor} | |
| # Return the rgb array or convert to hex | |
| # if hex, take into account zero padding | |
| if code === "rgb" | |
| color = rgb | |
| else |
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
| // depends on fetch, async/await (node 8.2.1+) | |
| require('isomorphic-fetch'); | |
| const getAllPlatforms = async apiKey => { | |
| const rawResponse = await fetch(`http://www.giantbomb.com/api/platforms?api_key=${apiKey}&format=json&field_list=name,id`); | |
| const response = await rawResponse.json(); | |
| // check response.error === "OK" && repsonse.status_code === 1 | |
| return response.results; | |
| } |
class Animal {
constructor(public name) { }
move(meters) {
alert(this.name + " moved " + meters + "m.");
}
}
class Snake extends Animal {
constructor(name) { super(name); }Check out particles.js for more info!
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
| // This style was pulled from: https://www.theguardian.com/science/2017/aug/21/solar-eclipse-eye-damage | |
| body { | |
| animation: eclipsed 8s ease-out infinite; | |
| opacity: 0.4; | |
| filter: blur(1px); | |
| } |
I hereby claim:
- I am forksofpower on github.
- I am forksofpower (https://keybase.io/forksofpower) on keybase.
- I have a public key ASDoSgFGsOpy5R8WHZOlc7G2GD8z11_KbOIM2JTggbCfQAo
To claim this, I am signing this object:
I use this implementation on my RuneAudio player to play a sound when the raspberry pi is powered on.
-
Place your audio file in /var/local/
cp startupsound.mp3 /var/local/
-
Create /usr/bin/startupsound.sh with these contents: