Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am dapperfox on github.
  • I am dapperfox (https://keybase.io/dapperfox) on keybase.
  • I have a public key ASCd_bPOC1ABTieaN4Q7EIYDxvpEBZeSqcRRvx2fU_mb-Ao

To claim this, I am signing this object:

Webpack Conversion

Problems with current setup

Asset Pipeline to Webpack

What's wrong with our current system?

  • Dependent on Sprockets-ES6 experimental "will never reach stable"
  • Poor debugging with es6
@DapperFox
DapperFox / index.js
Created November 12, 2014 16:16
register
server.route({
method: 'POST',
path: '/auth/register',
handler: function (req, res) {
var newUser = new userModel({ email: req.payload.username });
userModel.register(newUser, req.payload.password, function (err, user) {
if(err) {
res(err);
}
res(user);
@DapperFox
DapperFox / fsroute.js
Last active August 29, 2015 14:06
fs issues
'use strict';
var ImageUpload = require('./models/images.js');
module.exports = function(app, fs) {
app.post('/upload', isLoggedIn, function(req, res) {
req.pipe(req.busboy);
req.busboy.on('file', function(fieldname, file, filename) {
var image = new ImageUpload({
userID: req.user._id,
imageLocation: '/uploads/' + req.user._id + '/' + filename
@DapperFox
DapperFox / claytonhelp
Created August 23, 2014 22:23
for clayton
var allAdded = [];
var tutorial = function(data) {
var val1 = $item.find('item_parts').val();
var val2 = $item.find('required_to_make').val();
var container = {val1, val2};
allAdded.push(container);
};
$('form').submit(function(evt) {
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);
@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)) {
@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 / 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();
}
package learnlejos;
import lejos.nxt.SensorPort;
import lejos.nxt.TouchSensor;
import java.util.ArrayList;
/**
* Created by blakebishop on 5/20/14.