Skip to content

Instantly share code, notes, and snippets.

@gdotdesign
gdotdesign / Makefile
Created October 10, 2017 08:45
Foreman alternative using Make
target: run_backend run_frontend
start:
make -j2
run_frontend:
cd frontend && yarn live-server
run_backend:
cd backend && rails s
@gdotdesign
gdotdesign / CSSIntoArray.coffee
Created March 27, 2011 09:42
Get CSS properties (by rule) from Stylesheets into an object with MooTools.
( ->
selectors = {}
Array.from(document.styleSheets).each (stylesheet) ->
try
if stylesheet.cssRules?
Array.from(stylesheet.cssRules).each (rule) ->
selectors[rule.selectorText] = {}
Array.from(rule.style).each (style) ->
selectors[rule.selectorText][style] = rule.style.getPropertyValue(style)
selectors
module Main exposing (..)
import Html exposing (div, span, strong, text)
import Date
import Time
import Debug
import Date.Extra.Format exposing (isoString)
import Ext.Date
@gdotdesign
gdotdesign / elm-make-bug
Created July 11, 2016 03:43
Windows script to reproduce an elm-make bug
:loop
@echo off
rm -rf elm-make-bug
git clone git@github.com:gdotdesign/elm-make-bug.git > /dev/null 2>&1
cd elm-make-bug
elm-make Test.elm --yes > /dev/null 2>&1
perl -pi -e 's/A/B/g' Lib.elm
elm-make Test.elm --yes > /dev/null 2>&1
perl -pi -e 's/Lib.A/Lib.B/g' Bar.elm
elm-make Test.elm > /dev/null 2>&1
@gdotdesign
gdotdesign / elm-make-bug.sh
Created July 11, 2016 03:40
Script for testing an elm-make bug
#!/bin/bash
while true; do
rm -rf elm-make-bug
git clone git@github.com:gdotdesign/elm-make-bug.git > /dev/null 2>&1
cd elm-make-bug
elm-make Test.elm --yes > /dev/null 2>&1
perl -pi -e 's/A/B/g' Lib.elm
elm-make Test.elm --yes > /dev/null 2>&1
perl -pi -e 's/Lib.A/Lib.B/g' Bar.elm
@gdotdesign
gdotdesign / Dockerfile
Last active June 30, 2016 04:40
Dockering
FROM ubuntu:16.04
# Set Locale
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
# Setup
RUN apt-get update
@gdotdesign
gdotdesign / Main.elm
Last active May 26, 2016 06:58
Event handlers cannot be reattached after removing them.
import Html exposing (..)
import Html.Events exposing (..)
import Html.Attributes exposing (..)
import Html.App as App
import String
type alias Model =
{ haveEvent : Bool
, text : String
@gdotdesign
gdotdesign / EventListenerRemove.elm
Created May 15, 2016 09:38
Event listener not removed
import Html exposing (..)
import Html.Events exposing (..)
import Html.Attributes exposing (..)
import Html.App as App
import String
type alias Model =
{ haveTabindex : Bool
, text : String
@gdotdesign
gdotdesign / tabindex.elm
Created May 14, 2016 13:15
Tabindex not getting removed.
module Main exposing (..)
import Html exposing (..)
import Html.Events exposing (..)
import Html.Attributes exposing (..)
import Html.App as App
import String
type alias Model =
@gdotdesign
gdotdesign / Mail.elm
Created May 5, 2016 07:57
Uncaught TypeError: Cannot read property 'index' of undefined
import Html.Attributes exposing (style)
import Html.Events exposing (onClick, onMouseDown)
import Html exposing (node, div, text)
import Html.App
import Html.Lazy
type alias Model =
{ color : String
, clicks : Int