Skip to content

Instantly share code, notes, and snippets.

View mikegrassotti's full-sized avatar

Michael Grassotti mikegrassotti

View GitHub Profile
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
@mikegrassotti
mikegrassotti / vimrc
Last active August 29, 2015 14:20 — forked from r00k/vimrc
" A minimal vimrc for new vim users to start with.
"
" Referenced here: http://www.benorenstein.com/blog/your-first-vimrc-should-be-nearly-empty/
" Original Author: Bram Moolenaar <Bram@vim.org>
" Made more minimal by: Ben Orenstein
" Last change: 2012 Jan 20
"
" To use it, copy it to
" for Unix and OS/2: ~/.vimrc
@mikegrassotti
mikegrassotti / rails_list_routes.rb
Created April 2, 2015 19:31
Generate a list of routes in a rails app (to automate testing)
requests = Rails.application.routes.routes.
map {|r| "#{r.verb} #{r.path.spec.to_s}"}.
map {|p| p.gsub /..*(GET|DELETE|POST|PATCH|PUT)..* /, '\1 '}.
grep(/ \/api\/admin/).
map {|path| path.gsub("(.:format)", ".json")}.
map {|path| path.gsub(":id", "1")}
@mikegrassotti
mikegrassotti / ctxio-oauth2-test.rb
Created January 13, 2015 20:23
Use google refresh token to create a contextio account
# gem 'contextio'
# gem 'httparty'
# gem 'gmail_xoauth'
require 'gmail_xoauth'
require 'contextio'
require 'httparty'
ctxio_key = ENV['CTXIO_KEY']
ctxio_secret = ENV['CTXIO_SECRET']
import Ember from 'ember';
var names = ["Jacob", "Isabella", "Ethan", "Emma", "Michael", "Olivia", "Alexander", "Sophia", "William", "Ava", "Joshua", "Emily", "Daniel", "Madison", "Jayden", "Abigail", "Noah", "Chloe", "你好", "你你你"];
export default Ember.Component.extend({
tagName: 'textarea',
didInsertElement: function() {
this.$().atwho({
at: '@',
data: names
@mikegrassotti
mikegrassotti / ember-cli-rails-api-heroku.md
Last active August 29, 2015 14:07
MVP ember-cli with rails-api on heroku

EMBER-CLI + RAILS-API = EASY

ember-cli 0.1 is out lets celebrate by making lots of apps on heroku

Install prerequesites...

npm install -g ember-cli
gem install rails-api
brew cask install heroku-toolbelt
@mikegrassotti
mikegrassotti / node-stuff.sh
Created October 3, 2014 15:34
Random commands to see whats up in node env
# Which node is install
nvm current
# What packages are globally installed (high-level)
npm ls -g --depth=0
# Are they outdated?
npm install -g npm-check-updates #if not already installed
npm-check-updates -g
@mikegrassotti
mikegrassotti / env.js
Last active August 29, 2015 14:06
Parse ember-cli config/env using pure-javascript so it can be accessed before loading vendor libs
var env = function(namespace) {
return JSON.parse(unescape(document.getElementsByName(namespace + "/config/environment")[0].getAttribute("content")));
}
1 // app/initializers/session.js
2 export default {
3 name: 'session',
4 initialize: function() {
5 // code
6 }
7 };