Skip to content

Instantly share code, notes, and snippets.

View IainIsCreative's full-sized avatar
🎯
Focusing

Iain IainIsCreative

🎯
Focusing
View GitHub Profile
@IainIsCreative
IainIsCreative / bot_receiver.ino
Created August 3, 2018 20:03 — forked from ShawnHymel/bot_receiver.ino
Plastic Ant Combat Bot Receiver
/**
* Two Channel Receiver
* Author: Shawn Hymel (SparkFun Electronics)
* Date: Aug 24, 2017
*
* Updated Sep 28, 2017 - Added direction multiplier (DIR) to
* account for transmitter controller directions.
*
* Connect a TB6612FNG and RC (PWM) receiver to the Arduino.
* Mixes two channels for arcade drive.
@IainIsCreative
IainIsCreative / README.md
Last active March 26, 2018 14:20
Johnny-Five Smooth Hue Transition

Smooth RGB Hue Transition with Johnny-Five

This is a method of getting a smooth color transition from one color to the next for RGB Leds using Johnny-Five. The function changes the hue and goes through steps instead of just jumping to a color.

Required Packages

  • Johnny-Five
  • color-convert
  • Temporal (for non blocking sequences in place of setInterval.
import React, { Component, PropTypes } from 'react';
import { Link } from 'react-router';
import css from './Button.css';
export default class Button extends Component {
render() {
const {
className,
@IainIsCreative
IainIsCreative / contactform.js
Created April 26, 2017 19:23 — forked from insin/contactform.js
React contact form example
/** @jsx React.DOM */
var STATES = [
'AL', 'AK', 'AS', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'HI',
'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS',
'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR',
'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'WA', 'WV', 'WI', 'WY'
]
var Example = React.createClass({
@IainIsCreative
IainIsCreative / .wp-htaccess
Last active April 21, 2016 10:19
A `.htaccess` snippet we use for our WordPress projects
# ######################################################################
# CUSTOM HELPERS
# ######################################################################
# ----------------------------------------------------------------------
# Load images from remote server if they aren't found locally
# useful once a site has gone into production
# ----------------------------------------------------------------------
@IainIsCreative
IainIsCreative / dploy.example.yaml
Last active April 22, 2016 10:16
An example file for deploying our WordPress sites in each environment
# Dploy won't ever upload dev, dev should only be used for local env
# Add theme folder name, and subdomain for staging
# Dploy will only target the theme folder
staging:
host: "staging-host"
user: "staging-user"
pass: "staging-pass"
scheme: "ftp"
port: 21
@IainIsCreative
IainIsCreative / power.scss
Last active April 8, 2016 12:33
Sass Power Math Function
/**
*
* Power function in Sass.
*
* For power calculations in Sass.
* Place a number as a base, then a number to multiply from. Finally, add an
* exponent number.
*
* Simple example of such math being the speed of light:
* power(3, 10, 8);
@IainIsCreative
IainIsCreative / SassMeister-input.scss
Last active October 27, 2015 00:00
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
@mixin breakpoint($breakpoint) {
// The following code no longer works in libSass 3.3.0
// It will return an error and say it can't pass a content block
//Check if the value passed in is a unitless number
@if not unitless($breakpoint) {
@IainIsCreative
IainIsCreative / SassMeister-input.scss
Last active October 26, 2015 23:16
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
@mixin breakpoint($breakpoint) {
// The following code no longer works in libSass 3.3.0
//Check if the value passed in is a unitless number
@if not unitless($breakpoint) {
//Pass an error if not unitless.
@IainIsCreative
IainIsCreative / SassMeister-input.scss
Created October 19, 2015 10:03
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
// Nested map example
$nested-map: (
key-1: (
deep-key-1: (
deeper-key: true
),