Skip to content

Instantly share code, notes, and snippets.

@DapperFox
DapperFox / helasimple_login.as
Created February 5, 2014 21:10
Read for workout and lifting
// Reads workout from readWorkout.php
public function readWorkouts(kind:int)
{
var workoutLoader:urlLoader = new URLLoader;
var workoutVariables:URLVariables = new URLVariables;
var workoutURL:urlRequest = new urlRequest(path + "readWorkout.php");
workoutVariables.uid = userId;
workoutVariables.kind = kind;
workoutURL.data = workoutVariables;
@DapperFox
DapperFox / config file
Created March 24, 2014 19:55
config file
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>
</configSections>
@DapperFox
DapperFox / other config
Created March 24, 2014 19:56
other config
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=301880
-->
<configuration>
<connectionStrings>
<!--todo: change connectionString to correct database-->
<add name="MembershipConnectionString" connectionString="Data Source=50.56.188.176;Initial Catalog=Membership;Persist Security Info=True;User ID=sa;Password=lQ1%\ZUH;" providerName="System.Data.SqlClient"/>
@DapperFox
DapperFox / ThreadTest.java
Created May 20, 2014 22:42
Thread LejosTest
package learnlejos;
import lejos.nxt.*;
/**
* Created by blakebishop on 5/6/14.
*/
public class ThreadTest {
public static void main(String[] args) {
// TouchListener touchListener = new TouchListener();
package learnlejos;
import lejos.nxt.Motor;
/**
* Created by blakebishop on 5/20/14.
*/
public class TouchListener implements ITouchListener {
private boolean direction = false;
public TouchListener() {
package learnlejos;
import lejos.nxt.SensorPort;
import lejos.nxt.TouchSensor;
import java.util.ArrayList;
/**
* Created by blakebishop on 5/20/14.
@DapperFox
DapperFox / ITouchListener.java
Created May 20, 2014 22:44
Just the interface
package learnlejos;
/**
* Created by blakebishop on 5/20/14.
*/
public interface ITouchListener {
void changeState();
}
@DapperFox
DapperFox / roomLayout.js
Created August 22, 2014 00:48
mongoose schema to show Clayton
var mongoose = require('mongoose'),
Schema = mongoose.Schema,
ObjectId = Schema.ObjectId;
var RoomLayout = new Schema({
userID: ObjectId,
coordinates: Array,
type: String
});
@DapperFox
DapperFox / signup-form.js
Created August 22, 2014 03:44
ajax no worky
'use strict';
function validateEmail(email) {
var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(email);
}
$(document).ready(function() {
$('#register').submit(function(evt) {
var $regVals = $('#register').serializeArray();
if(!validateEmail($regVals[1].value)) {
app.post('/register', function(req, res) {
console.log(req.body.username + req.body.firstName + req.body.password);
User.register(new User({
username: req.body.username,
firstName: req.body.firstName,
role: 'Client',
completion: false
}), req.body.password, function(err, account) {
if (err) {
console.log(err);