Skip to content

Instantly share code, notes, and snippets.

View tgecho's full-sized avatar
🚧
Work In Progress

Erik Simmler tgecho

🚧
Work In Progress
View GitHub Profile
@tgecho
tgecho / dt.py
Last active January 9, 2020 02:59
A simple jq imitator that uses python expressions for filting
#!/usr/bin/env python3
import json
import sys
import argparse
import re
import pprint
parser = argparse.ArgumentParser()
@tgecho
tgecho / original.js
Last active March 30, 2017 13:24
elm-todomvc minification examples
(function() {
'use strict';
function F2(fun)
{
function wrapper(a) { return function(b) { return fun(a,b); }; }
wrapper.arity = 2;
wrapper.func = fun;
return wrapper;
@tgecho
tgecho / Bad.elm
Created March 5, 2016 14:18
Elm whitespace confusion
viewCounter address ( id, model ) =
let context =
Counter.Context
(Signal.forwardTo address (Modify id))
(Signal.forwardTo address (always (Remove id)))
in
Counter.viewWithRemoveButton context model
{-
==== error in Bad.elm:4:8: ====
@tgecho
tgecho / clipboard.html
Created January 18, 2016 22:10
This what Word 2013 for windows puts in the clipboard for otherwise unstyled text
<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 15">
<meta name=Originator content="Microsoft Word 15">
@tgecho
tgecho / Directional React Animations.markdown
Last active April 16, 2018 12:40
Directional React Animations

Directional React Animations

This is a demo of dynamic directional transitions using React's CSSTransitionGroup.

A Pen by tgecho on CodePen.

License.

# -*- mode: ruby -*-
# vi: set ft=ruby :
dir = File.dirname(__FILE__)
Vagrant.configure("2") do |config|
config.vm.box = "test"
config.vm.box_version = "1"
config.vm.box_url = "file://" + dir + "/packer/metadata.json"
end
@tgecho
tgecho / readme.txt
Created December 11, 2012 18:13
LiveReload compatibility hack for Webassets
Tested with LiveReload 2.3.18
The only requirement is that the updating requests are sent with ?livereload={etc} in the url.
LiveReload should be configured to NOT compile the assets, as we want webassets to take care of this. We're
just using LR for the notification/loading parts.
@tgecho
tgecho / autodepends.py
Created October 19, 2012 00:19
A proof of concept for automatic dependency detection
import re
from os import path, stat
from webassets import Bundle
from webassets.exceptions import BundleError
DEPENDS_REGEXES = map(re.compile, [
# http://stackoverflow.com/questions/4652777/java-regex-to-get-the-urls-from-css
# With addon to handle quotes
r'url[\s]*\([\s\'\"]*(?P<url>[^\)\'\"]*)[\s\'\"]*\)[\s]*',
@tgecho
tgecho / dabblet.css
Created August 1, 2012 14:57
New Item Link
/**
* New Item Link
*/
.new_item {
border: 1px dotted #000;
padding: 0.5em;
border-radius: 0.25em;
opacity: 0.5;
}
@tgecho
tgecho / salt_mock.py
Created April 5, 2012 16:27
Brainstormed mock for testing salt states and modules
class Mock(object):
def __init__(self):
history = []
unmet_expectations = []
def __call__(self, func, *args, **kwargs):
"""
Here we can grab a copy of the actual function/state and insert
the Mock object as __salt__ so the usual calls to