Skip to content

Instantly share code, notes, and snippets.

View cangevine's full-sized avatar

Colin Angevine cangevine

View GitHub Profile
@cangevine
cangevine / gist:8363273
Created January 10, 2014 21:44
Stepper motor example
// Wiring configuration to the stepper driver: yellow & red, gray & green
#include <Stepper.h>
const int STEPS_PER_REV = 200;
Stepper _stepper(STEPS_PER_REV, 12, 13);
const int pwmA = 3;
const int pwmB = 11;
const int brakeA = 9;
@cangevine
cangevine / gist:7931114
Created December 12, 2013 16:46
Get time and date information from PHP
<?php
// Get one aspect of the date, save it as a variable
$hour = date("H");
$minute = date("i");
$ampm = date("A");
// For more information on specifying the format with the letter codes, check here:
// http://www.php.net/manual/en/function.date.php
Stack.prototype.getLength = function() {
if (this.top == null) {
// If the Stack is empty, return 0
return 0;
} else {
// Otherwise start at the top, and begin counting at 1
var n = this.top;
var len = 1;
// Every time we call getNextNode() and get a Node object back (instead of null)...
while (n.getNextNode() != null) {
<!DOCTYPE html>
<html>
<head>
<title>Encrypt</title>
<link type="text/css" rel="stylesheet" href="ceasarcss.css" />
<script>
function encryptText(){
var key = 2;
var msg = document.getElementById('a').value;
for(i=0; i<msg.length; i++){
<!DOCTYPE html>
<html>
<head>
<script>
var message= prompt("type your message son");
var key = 2 ;
var alpha= "abcdefghijklmnopqrstuvwxyz" ;
<!DOCTYPE html>
<html>
<head>
<title>Caesar Cipher</title>
<script>
function cipher() {
var alphabet = "abcdefghijklmnopqrstuvwxyz";
var secretMessage = "alec";
var key = 3;
for(i = 0; i < secretMessage.length; i++){
<html>
<head>
<script type="text/javascript">
var plainTexts = document.getElementById("input");
plainText = plainTexts.value;
var alpha= "abcdefghijklmnopqrstuvwxyz";
var key= 2 ;
// plaintext.charAt (0) then keep going until you reach the length of the phrase//
function ceaserCypher() {