Skip to content

Instantly share code, notes, and snippets.

# example uses shared folder /media/sf_vm/www, change for your needs
sudo usermod -a -G vboxsf www-data
sudo usermod -a -G vboxsf <user name>
cd /etc/apache2/sites-available
sudo cp 000-default.conf weblab.conf
sudo nano weblab.conf
// Change DocumentRoot to point at your shared mount `www` directory /media/sf_vm/www
// cntrl-x then 'Y' to save changes
<html>
<head>
<style>
body {
padding: 0;
margin: 0;
}
var all_games =
[ [ [ 'X', 'X', 'X' ],
[ 'X', 'O', 'O' ],
[ 'X', 'O', 'O' ] ],
[ [ 'X', 'X', 'X' ],
[ 'X', 'O', 'O' ],
[ 'O', 'X', 'O' ] ],
@nw
nw / hilow.js
Created October 15, 2014 02:21
hi low game
var num;
var guesses = 0;
function newGame(min, max) {
num = getRandomInt(min, max);
guesses = 0;
}
function guess(myGuess){
guesses++;
@nw
nw / hilow.html
Created October 15, 2014 03:06
hi low game (html)
<html>
<head>
<style>
body {
background: #ccc;
}
#container {
@nw
nw / tabs.html
Last active August 29, 2015 14:07
tabs
<html>
<head>
<style>
body {
background: #ccc;
}
.tab-wrapper {
width: 50%;
@nw
nw / index.html
Created October 28, 2014 01:50
racecar
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>Racecar</title>
<link rel="stylesheet" href="racecar.css"/>
</head>
<body>
<div class="container">
@nw
nw / move.html
Created October 30, 2014 01:56
mouse move
<!doctype html>
<html>
<head>
<style>
body {
height: 4000px;
}
@nw
nw / userTable.js
Last active August 29, 2015 14:08
add users table
$(function(){
var table = $('#users');
var tbody = table.find('tbody');
var nameField = $('#name');
var emailField = $('#email');
var addButton = $('#add');
var clearAll = $('#clearAll');
@nw
nw / debug.js
Created November 7, 2014 06:40
var tessel = require('tessel')
, fs = require('fs')
, ambient = require('ambient-attx4').use(tessel.port['A'])
, audio = require('audio-vs1053b').use(tessel.port['D']);
var audioFile = fs.readFileSync('sample.mp3') // load mp3 into memory (small 29kb - 2.5 secs)
, timeout = 1000 * 60 // how long to wait after trigger and actions have happened.
, threshold = .2 // ambient noise trigger
, queue = 2; // number of modules to wait for