Skip to content

Instantly share code, notes, and snippets.

@DanielHeckrath
DanielHeckrath / index.js
Created Sep 28, 2017
Test gist for debug
View index.js
process.env.DEBUG = "*";
const debugPackage = require("debug");
const debuggers = [
debugPackage("debug"),
debugPackage("error"),
debugPackage("trace"),
debugPackage("warn"),
debugPackage("info")
];
View scrabble.py
# Will update the character count based on the used word
def updateHand(hand, word)
# this is where the magic happens
before = {'a': 1, 'b': 2, 'c': 3}
after1 = updateHand(before, 'abc')
after2 = updateHand(before, 'abc')
@DanielHeckrath
DanielHeckrath / app.js
Created Jul 15, 2015
React app with redux store. Uses custom provider/middleware to intercept actions that aren't meant for the reducers.
View app.js
class App extends React.Component {
render() {
return (
<ChatProvider store={redux}>
{::this.renderChildren}
</ChatProvider>
);
}
View ForegroundLinearLayout.java
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software