Skip to content

Instantly share code, notes, and snippets.

View ianjsikes's full-sized avatar

Ian J Sikes ianjsikes

View GitHub Profile
@ianjsikes
ianjsikes / states.json
Created December 5, 2017 18:15
US States and Territories JSON Array
[
"Alabama",
"Alaska",
"American Samoa",
"Arizona",
"Arkansas",
"California",
"Colorado",
"Connecticut",
"Delaware",
@ianjsikes
ianjsikes / screenshake.lua
Last active September 1, 2017 00:34
pico-8 Snippets
-- screenshake
shake = 0
if shake>0 then
shake-=1
camera()
if shake>0 then
camera(-2+rnd(5),-2+rnd(5))
end
end
@ianjsikes
ianjsikes / index.js
Last active September 28, 2017 18:53
const wasm = require('./main.rs')
wasm.initialize({noExitRuntime: true}).then(module => {
// Create a Javascript wrapper around our Rust function
const add = module.cwrap('add', 'number', ['number', 'number'])
console.log('Calling rust functions from javascript!')
console.log(add(1, 2))
})
fn main() {
println!("Hello, world!");
}
// Functions that you wish to access from Javascript
// must be marked as no_mangle
#[no_mangle]
pub fn add(a: i32, b: i32) -> i32 {
return a + b
}
module.exports = {
entry: './src/index.js',
output: {
filename: 'bundle.js',
path: __dirname + '/build',
},
module: {
rules: [
{
test: /\.rs$/,
<!DOCTYPE html>
<html>
<head>
<title>Hello World</title>
</head>
<body>
<div id="container"></div>
<script src="build/bundle.js"></script>
</body>
</html>
{
"scripts": {
"compile": "webpack --progress",
"serve": "http-server"
}
}
// Basic setup for a p5.js sketch
// This function gets called once at the start of the page load
function setup() {
// This creates an 800x800 HTML canvas element
createCanvas(800, 800);
}
// This function gets called ~60 times/second
function draw() {
simpleGradient fuchsia,color(100,200,200),yellow
move -3,-2,0
scale 2.1
x = 0
y = 0
5 times
x = 0
y += 0.1
move 0,y,0
pushMatrix
@ianjsikes
ianjsikes / guestbook.txt
Created April 30, 2017 23:14
CS 85 Homework - Unit 7 - Ian Sikes
Ian - Hey Everyone!