View rand.c
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
#include <webassembly.h> | |
struct rng_state { | |
unsigned int seed; | |
}; | |
export unsigned short type0_rand(struct rng_state *r) { | |
unsigned int t; | |
t = 0x41C64E6DUL * r->seed + 12345; |
View 1-users.js
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
import React from 'react'; | |
import { Link } from 'react-router-dom'; | |
import Table from 'table.js'; | |
function profileUrl(props, item) { | |
return { | |
to: `/admin/users/${item.id}`, | |
}; | |
} |
View MapKitAutocomplete.h
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
#import <React/RCTBridgeModule.h> | |
#import <MapKit/MapKit.h> | |
@interface MapKitAutocomplete : NSObject <RCTBridgeModule,MKLocalSearchCompleterDelegate> | |
@property (strong, nonatomic) MKLocalSearchCompleter *completer; | |
@end |
View private-methods.js
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
function Registry(defaultValue){ | |
const defaultValue = defaultValue; | |
const values = Object.create(null); | |
// These functions will always have access to the above variables. Javascript creates | |
// a closure when functions are created, so the outer scope is available to it. | |
// These first two functions are public | |
this.register = function(name, value){ | |
values[name] = value; | |
}; |
View js-sound-example.js
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
'use strict'; | |
// TODO Group audio files so we can control volume seperately | |
const context = new AudioContext(); | |
const soundDatas = {}; | |
const soundFiles = { | |
clear: '/audio/clear.wav', | |
fall: '/audio/fall.wav', | |
land: '/audio/land.wav', |
View life.js
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
// Conway's Game of Life for HTML5 Canvas | |
// By Simon Laroche | |
var FPS = 5; | |
var paused = true; | |
var gameStarted = false; | |
var gLoop; | |
var generations = 0; | |
var population = 0; |
View snake.js
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 FPS = 10; | |
var gLoop; | |
var lastX; | |
var lastY; | |
var canvas = document.getElementById('c'); | |
var ctx = canvas.getContext('2d'); | |
var info = document.getElementById('i'); | |
var wrapper = document.getElementById('w'); | |
var classic = document.getElementById('classic'); |
View tictactoe.js
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 canvas = document.getElementById('canvas'); | |
var ctx = canvas.getContext('2d'); | |
canvas.addEventListener('click', on_canvas_click, false); | |
var grid = [['', '', ''], ['', '', ''], ['', '', '']]; | |
var turn = 'X'; | |
var cord_x; | |
var cord_y; | |
var reset = false; |