Skip to content

Instantly share code, notes, and snippets.

Setting up MiLight Wifi Bridge and LimitlessLED bulbs with Amazon Alexa and Home Automation Bridge

Goal of this tutorial

Be able to control MiLight bulbs with Amazon Alexa via the MiLight Wifi Bridge.

Materials

@mcmatrix
mcmatrix / ModelForm.js
Created January 27, 2020 15:21 — forked from esatterwhite/ModelForm.js
Class For rendering and validating forms in Sencha Touch
/**
* Module for General utility functions and classes
* @module utils
*
*/
Ext.ns('BlackjackM','BlackjackM.utils', 'BlackjackM.utils.forms');
/**
* A class which renders and validates a form based on a Ext.data.Model or Model instace
@mcmatrix
mcmatrix / snake.py
Created November 29, 2019 14:44 — forked from sanchitgangwar/snake.py
Snakes Game using Python
# SNAKES GAME
# Use ARROW KEYS to play, SPACE BAR for pausing/resuming and Esc Key for exiting
import curses
from curses import KEY_RIGHT, KEY_LEFT, KEY_UP, KEY_DOWN
from random import randint
curses.initscr()
win = curses.newwin(20, 60, 0, 0)
@mcmatrix
mcmatrix / pr.md
Last active October 15, 2018 19:42 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@mcmatrix
mcmatrix / 0fixup.md
Created July 27, 2018 13:38 — forked from silent1mezzo/0fixup.md
On undoing, fixing, or removing commits in git

A git choose-your-own-adventure!

This document is an attempt to be a fairly comprehensive guide to recovering from what you did not mean to do when using git. It isn't that git is so complicated that you need a large document to take care or your particular problem, it is more that the set of things that you might have done is so large that different techniques are needed depending on exactly what you have done and what you want to have happen.

@mcmatrix
mcmatrix / grrr.sh
Created June 22, 2018 17:36 — forked from Bertrand/grrr.sh
merge master into staging and staging into testing
#!/bin/sh
git diff --quiet --exit-code
if [ $? -ne 0 ]; then
echo "Cannot run grrr if you have uncommited changes"
exit -1;
fi
current_branch=`git rev-parse --abbrev-ref HEAD`
if [ "$current_branch" == "HEAD" ]; then
@mcmatrix
mcmatrix / Merging PR for 2 branches
Created June 22, 2018 17:35 — forked from alopresto/Merging PR for 2 branches
Instructions to merge pull requests for multiple branches (master, support, etc.)
#Steps to merge/close pull requests with two main branches
As NiFi now has a 1.0 (master) and 0.x (support) branch, pull requests (PR) must be applied to both. Here is a step-by-step guide for committers to ensure this occurs for all PRs.
1. Check out the latest master
``` $ git checkout master
$ git pull upstream master
```
2. Check out the PR (example #327). This will be in `detached-HEAD` state. (Note: You may need to edit the `.git/config` file to add the `fetch` lines [below](#fetch))
@mcmatrix
mcmatrix / README.md
Created June 20, 2018 20:11 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@mcmatrix
mcmatrix / gist:c19d3dd3a92d7a32f0eae4619663736e
Last active September 17, 2019 14:05 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date
1. Clone your fork:
git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git
2. Add remote from original repository in your forked repository:
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
3. Updating your fork from original repo to keep up with their changes:

git pull upstream master

@mcmatrix
mcmatrix / Firewall.js
Created May 29, 2018 15:43 — forked from havvg/Firewall.js
ExtJS 6: JSON Web Token API Login with Promises
Ext.define('App.security.Firewall', {
singleton: true,
requires: [
'App.security.TokenStorage'
],
login: function(username, password) {
var deferred = new Ext.Deferred();
Ext.Ajax.request({