Skip to content

Instantly share code, notes, and snippets.

View BinaryMuse's full-sized avatar
🏳️‍🌈
Just gayin' up the place the best I can

Michelle Tilley BinaryMuse

🏳️‍🌈
Just gayin' up the place the best I can
View GitHub Profile
@BinaryMuse
BinaryMuse / complete.js
Last active June 13, 2019 03:30
DND: Blog Post - Staggered Animation with React Motion
import React from "react";
import { Motion, StaggeredMotion, spring } from "react-motion";
import { constant, range } from "lodash";
const DEG_TO_RAD = Math.PI / 180;
const MAIN_BUTTON_DIAM = 100;
const CHILD_BUTTON_DIAM = 50;
const CHILDREN_ICONS = [
"at", "linkedin", "facebook", "github", "twitter"
@BinaryMuse
BinaryMuse / README.md
Last active January 31, 2016 21:14
ES7 Decorator version of `LinkedStateMixin` that supports dot-separated paths

Make your React ES6 classes LinkState aware with a decorator. Supports nested state keys by specifying the key name with dots.

@NestedValueLink
class MyComponent extends React.Component {
  constructor(...args) {
    super(...args);

    this.state = {
 path: { to: { key: "" } }
_ = require("underscore");
# https://github.com/BinaryMuse/trie-hard
dictionary = require "./dictionary"
letters = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
scores = [ 1, 3, 3, 2, 1, 4, 2, 4, 1, 8, 5, 1, 3, 1, 1, 3, 10, 1, 1, 1, 1, 4, 4, 8, 4, 10]
scoresByLetter = _.object(letters, scores)
class ScrabbleGame
module Game where
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (onClick)
import Array exposing (Array)
import Maybe exposing (withDefault, andThen)
@BinaryMuse
BinaryMuse / index.html
Last active October 10, 2015 13:47
JSBin Template
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.rawgit.com/lodash/lodash/3.0.1/lodash.min.js"></script>
<script src="//fb.me/react-0.14.0-rc1.js"></script>
<script src="//fb.me/react-dom-0.14.0-rc1.js"></script>
<script src="https://code.jquery.com/jquery.min.js"></script>
<!--<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">-->
<!--<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">-->
<meta charset="utf-8">
@BinaryMuse
BinaryMuse / webpack.config.js
Last active August 29, 2019 13:44
webpack less -> css with source maps via extracttextplugin
var webpack = require("webpack");
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var lessLoader = ExtractTextPlugin.extract(
"css?sourceMap!less?sourceMap"
);
module.exports = {
cache: true,
entry: { bundle: "./master/client/index.jsx" },
@BinaryMuse
BinaryMuse / README.md
Last active April 20, 2022 21:45
Elixir Map/HashDict Performance on Erlang OTP R17 vs R18
@BinaryMuse
BinaryMuse / restful.js
Last active March 17, 2019 08:22
Express API with Async/Await
import express from "express";
/**
* Takes a route handling function and returns a function
* that wraps it after first checking that the strings in
* `reserved` are not part of `req.body`. Used for ensuring
* create and update requests do not overwrite server-generated
* values.
*/
function checkReservedParams(routeHandler, ...reserved) {
@BinaryMuse
BinaryMuse / gist:1ef56674787db244343a
Last active August 29, 2015 14:10
Add .done to native ES6 Promises
/* Native HTML5 promises will swallow exceptions if you're not careful. For example:
*
* promise.then(function() {
* something.froEach(iterator);
* });
*
* This extension patches the Promise prototype with a `done` method that will log errors:
*
* promise.then(function() {
* something.froEach(iterator);
@BinaryMuse
BinaryMuse / gist:3b0a4ba166ac81840cab
Created November 3, 2014 16:20
Async fetches initiated by the store when necessary
// Component
var AnswerDisplay = React.createClass({
mixins: [FluxMixin, StoreWatchMixin("answer")],
getStateFromFlux() {
var flux = this.getFlux(),
answerStore = flux.store("answer");
return {