Skip to content

Instantly share code, notes, and snippets.

View mike-north's full-sized avatar
Wish I had more time to work on OSS

Mike North mike-north

Wish I had more time to work on OSS
View GitHub Profile
@mike-north
mike-north / application.controller.js
Last active November 2, 2015 21:52
animated width
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
{
"trips": [{
"date": "11-4-2015",
"destination": {
"name": "Tokyo, Japan",
"lat": "35.6833",
"lng": "139.6833"
}
}, {
"date": "11-14-2015",
@mike-north
mike-north / application.controller.js
Created March 14, 2016 15:34
Error on multiple yield w/ contextual components
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@mike-north
mike-north / conferences.md
Last active March 23, 2016 15:14
Mike's Upcoming Conference Schedule
Emberconf 2016
💻 emberconf.com
📢 Building Stateful UIs with Ember.js
🗓 March 29-30, 2016
📍 Portland, OR 🇺🇸
Ruby on Ales 2016 (Attending only)
💻 ruby.onales.com
defmodule Peepchat.Router do
use Peepchat.Web, :router
pipeline :api do
plug :accepts, ["json", "json-api"]
end
scope "/api", Peepchat do
pipe_through :api
# Route stuff to our SessionController
@mike-north
mike-north / components.my-link.js
Last active April 29, 2016 16:48
extending link-to
@mike-north
mike-north / controllers.application.js
Last active May 6, 2016 17:20
link-to-with-model
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
queryParams: ['a'],
a: ""
});
@mike-north
mike-north / user.ex
Created May 28, 2016 04:58
ELIXIR - Validating a password for length and complexity in Ecto
defmodule MyApp.User do
def changeset(model, params \\ :empty) do
model
|> cast(params, @required_fields, @optional_fields)
|> validate_format(:email, ~r/@/)
|> validate_length(:password, min: 8)
|> validate_format(:password, ~r/[0-9]+/, message: "Password must contain a number") # has a number
|> validate_format(:password, ~r/[A-Z]+/, message: "Password must contain an upper-case letter") # has an upper case letter
|> validate_format(:password, ~r/[a-z]+/, message: "Password must contain a lower-case letter") # has a lower case letter
|> validate_format(:password, ~r/[#\!\?&@\$%^&*\(\)]+/, message: "Password must contain a symbol") # Has a symbol
@mike-north
mike-north / controllers.application.js
Created June 5, 2016 04:33
Cat picture generator
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
w: 100,
h: 200,
kittehUrl: Ember.computed('w', 'h', function() {
var { w, h } = this.getProperties(['w', 'h']);
return `https://placekitten.com/${w}/${h}`;
@mike-north
mike-north / phoenix_resources.md
Created June 29, 2016 21:09
Phoenix Resoures