Skip to content

Instantly share code, notes, and snippets.

David Waller krawaller

Block or report user

Report or block krawaller

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Guesses_index.js
import React from "react";
export const Guesses = props => {
return (
{, n) => (
<li key={n}>{guess}</li>
View todo.html
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
.done {
background-color: #DDD;
krawaller / object.js
Created Nov 1, 2017
object lookup examples
View object.js
var me = {
name: "David Waller",
nickName: "Davve",
prop: "kopp"
var formalSituation = true;
var prop;
krawaller / components.ts
Created Jul 25, 2017
Angular components as table rows
View components.ts
import { Component, Input } from '@angular/core';
selector: 'app',
template: `
<tr magicrow msg="hello"></tr>
<tr magicrow msg="world"></tr>

To create a container, I only need to add my AppState typings to the mapStateToProps parameter:

const mapStateToProps = (state: State) => ({
  messages: state.messaging.messages

const mapDispatchToProps = (dispatch) => ({
  dismissUIMessage: (num) => dispatch(actions.dismissUIMessage(num))
krawaller /
Created May 9, 2017
Enforcing Firebase relation validity

Say we have a database of users and roles, where each user belongs to a role. Using the denormalized Firebase approach I might store that like this:

  "users": {
    "abc123": {
      "name": "Joe",
      "role": "kkk333"
    // lots more users
krawaller / ng.html
Created May 10, 2016
fun fun angular stuff :)
View ng.html
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>Exercise 1</title>
.done {
text-decoration: line-through;
krawaller / exercise1.html
Last active May 10, 2016
angular cheating
View exercise1.html
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>Exercise 1</title>
<script src="../jquery.js"></script>
<script src="../angular.js"></script>
.selected {
text-decoration: line-through;
View myapp.js
var tags = ['urgent','blocked','boring','hard'],
callbacks = [];
return {
addTag: function(t){
krawaller /
Last active Jan 27, 2016
Grokking angular by claims
  • ng-submit * only makes sense on a <form> tag * is just an event handler much like ng-click
  • ng-options * only makes sense on a <select> tag * enables us to have objects as selected values instead of just strings * saves us from having to type out <options ng-repeat="..." ... /> * provides additional shortcut for <optgroup> through :groupBy
  • ng-click
  • should always be a method call, don't do assignments as that relies on brittle scoping and is hard to test
You can’t perform that action at this time.