Skip to content

Instantly share code, notes, and snippets.

View mattraykowski's full-sized avatar

Matt Raykowski mattraykowski

View GitHub Profile
import { fetchUser } from '../../firebase/users/read';
// Mock user to return when fetched.
const mockUser = {
name: 'Bob',
};
// Mocked Firebase fetch user.
export const fetchUser = (doResolve, returnValue) => () => new Promise(
(resolve, reject) => process.nextTick(() => doResolve ? resolve(returnValue) : reject(returnValue))
describe('#handleCardAddition', () => {
let cards;
let editingDecklistCards;
const handleCardAddition = value => {
const cardToAdd = cards.allCards.find(c => c.name === value);
// Check to see if the card exists, if it does then add it.
if (editingDecklistCards.hasOwnProperty(cardToAdd.cardId)) {
cardToAdd.amount = 2;
@mattraykowski
mattraykowski / test.js
Created September 15, 2016 20:21
JavaScript references make Angular hell.
function controllerOne(varA) {
var vm = this;
vm.a = varA;
vm.printA = function() {
console.log('A is: ', vm.a)
}
vm.setA = function(a) {
vm.a.a = a;
@mattraykowski
mattraykowski / vassalweb.md
Last active August 10, 2016 21:36
VASSAL Web Enhancements

VASSAL Web

Summary

VASSAL is a table-top game simulation with many board game modules. It currently supports live games and "PBEM" games through "log" sharing - a sequence of commands such as moving tiles, etc. The server is any standards-compliant XMPP server. I have configured ejabberd and connectd two VASSAL clients to it playing the same module to very that it works.

Components

const _ = require('lodash');
var foo = {
ReportList: {
Report: [
{
Graph: [
{
$: {
title: 'something',
graphtype: 'something'
@mattraykowski
mattraykowski / hedwig-phoenix-log.txt
Created June 28, 2016 14:19
Hedwig-IM and Phoenix Dependency Collisions
➜ omgbot mix deps.get
Running dependency resolution
Failed to use "cowlib" (versions 1.0.0 to 1.0.2) because
cowboy (versions 1.0.0 to 1.0.4) requires ~> 1.0.0
gun (version 1.0.0-pre.1) requires 1.3.0
Failed to use "poison" (versions 1.3.0 to 1.5.2) because
ecto (version 1.1.8) requires ~> 1.0 or ~> 2.0
hedwig_slack (version 0.1.0) requires ~> 2.0
@mattraykowski
mattraykowski / whatever.rb
Created June 2, 2016 18:26
Infoblox fetching related objects
def something(connection)
addresses = Infoblox::Ipv4address.find(connection,{"network" => "172.16.1.1/25"});
addresses.each do |address|
if address.objects.empty?
puts "No objects"
else
# Get all of the related objects.
objects = address.objects
# Loop over each related object.
(function() {
'use strict';
/* Usage: <input type="password" name="myPassword sensitive-field> */
angular.module('kd.core.admin.common').directive('sensitiveField', sensitiveField);
function sensitiveField() {
var directive = {
link: link,
restrict: 'A'
@mattraykowski
mattraykowski / date.format.filter.js
Last active January 14, 2016 21:24
Moment Date Format for Angular
(function() {
'use strict';
angular
.module('kd.common.components')
.filter('dateFormat', dateFormat);
/* @ngInject */
function dateFormat(moment) {
return filter;
@mattraykowski
mattraykowski / index.coffee
Created January 12, 2016 16:02
wintersmith-libsass fix for node 3.0.0 style callbacks.
fs = require 'fs'
sass = require 'node-sass'
ccss = require 'clean-css'
module.exports = (env, callback) ->
class NodeSassPlugin extends env.ContentPlugin
constructor: (@filepath) ->