Skip to content

Instantly share code, notes, and snippets.

@DapperFox
DapperFox / Lab1.Driver
Created July 19, 2013 04:44
C# - TimeSheet Application
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//http://collabedit.com/pg9sd
namespace Lab1
{
class Driver
{

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:

@DapperFox
DapperFox / gist:6511029
Created September 10, 2013 15:24
updateDatabaseView method for Inventory Project
private void updateDatabaseView(InventoryCategory selectedCategory)
{
String typeString = "InventoryProject." + selectedCategory.ToString();
Type selectedType = Type.GetType(typeString);
if (selectedType != null)
{
List<IInventoryItem> selectedItems = new List<IInventoryItem>();
@DapperFox
DapperFox / Lab3 Finished
Created August 14, 2013 00:18
Final with comments
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Lab3
{
class Program
{
foreach (var s in data.AllPeople.Where(person => person.ZipCode.ToString().Contains("3")))
{
Console.WriteLine(s.ToString());
}
Console.ReadLine();
@DapperFox
DapperFox / class tutorial
Created July 31, 2013 21:43
class tutorial
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Untitled</title>
<link rel="stylesheet" href="css/style.css">
<link rel="author" href="humans.txt">
</head>
Console.WriteLine("Enter the first day of the week (day, month, year) eg(24, 02, 2013)");
string userInput = Console.ReadLine();
if (dateArray[0] < 1 && dateArray[0] > 31 || dateArray[1] < 1 && dateArray[1] > 12 || dateArray[2] < 1000 && dateArray[2] > 2013)
{
Console.WriteLine("Incorrect form for a date. Please try again.");
InputHours();
}
string[] splitDate = userInput.Split(',');
for (int i = 0; i < splitDate.Length; i++)

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