Skip to content

Instantly share code, notes, and snippets.

View IainIsCreative's full-sized avatar
🎯
Focusing

Iain IainIsCreative

🎯
Focusing
View GitHub Profile
@ShawnHymel
ShawnHymel / bot_receiver.ino
Created September 28, 2017 20:56
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.
var Emitter = require("events").EventEmitter;
var five = require("../lib/johnny-five.js");
var board = new five.Board();
var emitter = new Emitter();
function Encoder(opts) {
Emitter.call(this);
var last = 0;
@jamesslock
jamesslock / Button.react.js
Created April 20, 2016 00:26
React Button
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,
@BenMorel
BenMorel / viewport-units-ios.scss
Last active March 11, 2022 13:15
SCSS mixin to support vh and vw units on all iOS Safari versions. Based on an idea by Patrick Burtchaell's: https://gist.github.com/pburtchaell/e702f441ba9b3f76f587
/**
* Fix for vw, vh, vmin, vmax on iOS 7.
* http://caniuse.com/#feat=viewport-units
*
* This fix works by replacing viewport units with px values on known screen sizes.
*
* iPhone 6 and 6 Plus cannot run iOS 7, so are not targeted by this fix.
* Target devices running iOS 8+ will incidentally execute the media query,
* but this will still produce the expected result; so this is not a problem.
https://github.com/imamathwiz/atom-hide-files
https://github.com/P233/Atom-Syntax-highlighting-for-Sass
https://github.com/danielbrodin/atom-project-manager
https://github.com/Exter-N/recent-projects
https://github.com/bkbooth/color-gutter
https://github.com/emmetio/emmet-atom
https://github.com/DanBrooker/file-icons
https://github.com/sommerper/filetype-color
https://github.com/abe33/atom-color-highlight
https://github.com/akonwi/git-plus
@insin
insin / contactform.js
Last active January 9, 2024 05:27
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({
@JeffreyWay
JeffreyWay / gist:5695346
Created June 2, 2013 23:33
And we wonder why we get overwhelmed.
So you want to accept payments online with PHP?
- Well, you probably don't want to handle that process manually. Too dangerous and risky.
- So learn the Stripe API. Works great!
- But you'll still need to setup SSL. So go learn how to do that.
- Stripe provides a PHP package, so download that through Composer. If you're not familiar with Composer, you'll need to learn that too.
- If you want the most flexibility, you'll want to manually create the payment form.
- So you'll need to send an AJAX request with a special token to Stripe's API. jQuery makes this easy, so go learn jQuery.
- Once the payment completes, you'll likely want to send the buyer a "Purchased" email, so learn how to send email.
- But don't make the user wait for the email to send. That takes too long. Add that to a background job.