Skip to content

Instantly share code, notes, and snippets.

Josh Smith joshsmith

Block or report user

Report or block joshsmith

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@joshsmith
joshsmith / material-colors.json
Created May 17, 2019
Material UI colors (500) in JSON, not including greys and browns
View material-colors.json
{
"red": "#f44336",
"pink": "#e91e63",
"purple": "#9c27b0",
"deeppurple": "#673ab7",
"indigo": "#3f51b5",
"blue": "#2196f3",
"lightblue": "#03a9f4",
"cyan": "#00bcd4",
"teal": "#009688",
View addon.md

Including the library

Sadly, elements is not a separate library.

It's just a part of the still in development Stripe.js v3, so the only way to include it is to include the whole script in the page somewhere. There is no bower library, no amd/require/commonjs package of any sort.

This is the only way to include it:

<script src="https://js.stripe.com/v3/"></script>
@joshsmith
joshsmith / stripe_states.js
Created Dec 17, 2016
Stripe Supported States (as of 12/16/2016)
View stripe_states.js
{ name: "Alabama", id: "AL" },
{ name: "Alaska", id: "AK" },
{ name: "Arizona", id: "AZ" },
{ name: "Arkansas", id: "AR" },
{ name: "California", id: "CA" },
{ name: "Colorado", id: "CO" },
{ name: "Connecticut", id: "CT" },
{ name: "Delaware", id: "DE" },
{ name: "District of Columbia", id: "DC" },
{ name: "Florida", id: "FL" },
View components.raised-hands.js
import Ember from 'ember';
const {
Component,
computed,
get,
run,
set
} = Ember;
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
model: function() {
return {
choices: [
'friend',
'foe'
]
View bower.json
{
"name": "code-corps-ember",
"dependencies": {
"pace": "^1.0.2",
"dom-ruler": "0.1.13",
"es5-shim": "^4.5.9",
"FakeXMLHttpRequest": "^1.4.0",
"route-recognizer": "^0.2.6",
"pretender": "^1.1.0",
"Faker": "^3.1.0",
View error-formatter.js
import Ember from 'ember';
/**
`error-formatter' returns a formatted error message. Place within an 'if'
block to return only when there really is an error.
## default usage
```Handlebars
{{#if error}}
@joshsmith
joshsmith / united_states_subdivision.rb
Created Apr 10, 2016
List of United States subdivisions: states, territories, and DC with FIPS codes and postal abbreviations
View united_states_subdivision.rb
UnitedStatesSubdivision.create([
{
name: "Alabama",
postal_abbreviation: "AL",
fips_code: "01",
},
{
name: "Alaska",
postal_abbreviation: "AK",
fips_code: "02",
@joshsmith
joshsmith / rebase.md
Created Mar 1, 2016
Doing a git rebase and squash
View rebase.md

If you've had a pull request reviewed and accepted, congratulations! Before we can merge your changes, we'll need you to rebase off origin/develop and squash your commits into one. This will give us a cleaner git history.

Never done this before? No problem. We'll walk you through it, and you can read a deeper guide about rewriting history to understand more.

On your command line you'll want to do:

git rebase -i origin/develop
View something.swift
func textFieldDidBeginEditing(textField: UITextField) {
print(textField.tag)
switch textField.tag {
case 0:
if textField.text == "First name" { textField.text = nil }
case 1:
if textField.text == "Last name" { textField.text = nil }
default:
textField.text = nil
}
You can’t perform that action at this time.