Skip to content

Instantly share code, notes, and snippets.

#include "LPD8806.h"
#include "SPI.h" // Comment out this line if using Trinket or Gemma
#ifdef __AVR_ATtiny85__
#include <avr/power.h>
#endif
// Number of RGB LEDs in strand:
int nLEDs = 32;
import java.util.*;
/**
* Solve the methods below
*
* Mr. Memmo
* 10/29
* NOTE: for all of these. They should work if I switch values
*/
public class ProgrammingChallenge
{
//STARTER CLASS
import javax.swing.JFrame;
public class Starter extends JFrame {
public Starter()
{
add(new Board());
setTitle("Board");
setDefaultCloseOperation(EXIT_ON_CLOSE);
@memish
memish / index.html
Last active November 20, 2017 17:35
Draw HTML File
<html>
<head>
<title>Beginners Code</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<style>
canvas{ border: 1px solid black; }
</style>
<script src="/socket.io/socket.io.js"></script>
@memish
memish / server.js
Created November 20, 2017 17:41
Server file for drawing app
var app = require('express')();
var http = require('http').Server(app);
var io = require('socket.io')(http);
app.get('/', function(req, res){
res.sendFile(__dirname + '/index.html');
});
io.on('connection', function(socket){
<html>
<head>
<title>Beginners Code</title>
<style>
canvas{ border: 1px solid black; }
</style>
import java.io.*;
import java.net.URL;
/**
* This is a little demo showing how to read text files. It will find files
* that are situated anywhere in the classpath.
*
* Currently, two demo methods are available. Both simply print a text file to the
* terminal. One returns exceptions in case of a problem, the other prints out
* error messages.
public class Multiply
{
private int a;
private int b;
public Multiply(int a, int b)
{
this.a = a;
this.b = b;
import java.awt.event.MouseListener;
import java.awt.event.MouseEvent;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Toolkit;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
<html>
<head>
<title>Penny Game</title>
<style>
canvas{ border: 1px solid black; }
</style>
</head>
<body>