Skip to content

Instantly share code, notes, and snippets.

View evilmarty's full-sized avatar

Marty Zalega evilmarty

View GitHub Profile
@evilmarty
evilmarty / genio-ir-controller-template.yaml
Last active February 26, 2023 05:49
Genio IR Controller ESPHome Template
substitutions:
name: "genio-ir-controller"
# Get this value from https://esphome.io/components/climate/climate_ir.html
ac_platform: "coolix"
dashboard_import:
package_import_url: https://gist.githubusercontent.com/evilmarty/48c81b3a76558a7489fb4168d02d916c/raw/dd8dc2e216cad8e36cfb4d60dbd0d0527c10aaee/genio-ir-controller-template.yaml
esphome:
name: "${name}"
@evilmarty
evilmarty / .bashrc
Created December 9, 2021 23:13
Check if your AWS SSO session is still valid and if not prompt a message
AWS_SSO_CACHE="${HOME}/.aws/sso/cache"
check_aws_sso_session() {
local files=()
if [ -d "$AWS_SSO_CACHE" ]; then
local files=("${AWS_SSO_CACHE}/*.json")
fi
for file in ${files[@]}; do

Keybase proof

I hereby claim:

  • I am evilmarty on github.
  • I am evilmarty (https://keybase.io/evilmarty) on keybase.
  • I have a public key ASC4aCr6fEhHPwob7iVjuPPwFKDitQCjhY3Z4-5SuamHlQo

To claim this, I am signing this object:

@evilmarty
evilmarty / git-pr
Created July 22, 2015 03:31
git pull request workflow
!/bin/bash
PULL_REQUEST_TEMPLATE="\n# Please enter the message for your pull request. Lines starting\n# with '#' will be ignored, and an empty message aborts the commit.\n# On branch %s"
branch=$(git rev-parse --abbrev-ref HEAD);
if [ "$branch" = "master" ]; then
echo "Cannot create pull request on master branch";
exit 1;
fi
@evilmarty
evilmarty / run.sh
Created February 16, 2015 05:55
Run a process defined in a Procfile
#!/bin/sh
cwd=$(pwd)
process=$1
procfile="$cwd/Procfile"
if [ ! -r $procfile ] ; then
echo "$procfile does not exist or is not readable"
exit -1
fi
@evilmarty
evilmarty / state_machine.js
Created January 5, 2014 06:26
A small and simple state machine in Javascript.
function StateMachine(options) {
options = options || {};
if (!(this instanceof StateMachine)) {
return new StateMachine(options);
}
var states = this.states = (options.states || this.states),
initialState = this.initialState = (options.initialState || this.initialState || Object.keys(states).shift());
@evilmarty
evilmarty / userscript.js
Last active December 21, 2015 20:29
Campfire avatar userscript
// ==UserScript==
// @name Campfire Avatar
// @namespace http://firefromthefly.com
// @version 0.1
// @description Adds peoples avatars to the chatroom.
// @match https://*.campfirenow.com/room/*
// @copyright 2012+, You
// ==/UserScript==
var insertMessages = Campfire.Transcript.prototype.insertMessages;
@evilmarty
evilmarty / dabblet.css
Created May 12, 2013 02:02
Fancy textfield
/* Fancy textfield */
.fancy-textfield {
display: inline-block;
position: relative;
}
.fancy-textfield > .fancy-textfield-input, .fancy-textfield > .fancy-textfield-placeholder {
color: #fff;
font: 16px/120% Helvetica,Arial,sans-serif;
padding: 10px 0;
}
html {
background: #f06;
background: linear-gradient(90deg, #cceecc,#eeeeee);
min-height: 100%;
}
input[type=date] {
background: #ccc;
background: linear-gradient(90deg, #ddd, #ccc);
border: 3px solid #eee;
border-radius: 20px;
@evilmarty
evilmarty / README.md
Last active December 14, 2015 13:39
Ember-backed autocomplete

In my journey in figuring out the Ember pattern, this is my attempt at trying to create an Ember-only autocomplete field. There were a few outcomes I wanted out of this, a part from being the Ember-way:

  • Work with any data source
  • Easily templatable results
  • Use only Ember constructs

All are welcome to use this, I'm just after feedback at this point.