Skip to content

Instantly share code, notes, and snippets.

@chrism
chrism / standard_template.rb
Created March 31, 2012 15:30
Time saving template for Rails 3.2 projects using the standard configuration options
repo_name = app_name.gsub('_','-')
say "creating superuser for postgres with username : #{app_name}"
run "createuser #{app_name}"
say "initializing git repository"
git :init
say "adding .DS_Store & .env to .gitignore file"
append_to_file ".gitignore" do <<-TXT
@chrism
chrism / one_line_ruby_webserver
Created July 5, 2013 09:37
One line webserver using ruby
ruby -run -e httpd . -p 5000
@chrism
chrism / jsbin.fuzu.html
Last active August 29, 2015 13:56
Working munging from API into Ember Data format
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Working munging from API into Ember Data format" />
<meta charset="utf-8">
<title>Ember Starter Kit</title>
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/normalize/2.1.0/normalize.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars-v1.2.1.js"></script>
<script src="http://builds.emberjs.com/ember-latest.js"></script>
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Working munging from API into Ember Data format" />
<meta charset="utf-8">
<title>Ember Starter Kit</title>
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/normalize/2.1.0/normalize.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars-v1.2.1.js"></script>
<script src="http://builds.emberjs.com/ember-latest.js"></script>
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Ember mapBy Example" />
<meta charset="utf-8">
<title>Ember mapBy Example</title>
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/normalize/2.1.0/normalize.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars-v1.3.0.js"></script>
<script src="http://builds.emberjs.com/ember-latest.js"></script>
Notice: Compiled catalog for dev.instatube in environment production in 6.88 seconds
Notice: /Stage[main]/Main/Node[dev]/Package[rails]/ensure: ensure changed '4.1.0' to '1.8'
Notice: /Stage[main]/Beanstalkd/File[/tmp/build-beanstalkd.sh]/ensure: defined content as '{md5}afe2601c6d287d01029a9a392f98027f'
Notice: /Stage[main]/Sonic-annotator/File[/tmp/sonic-annotator_1.0_amd64.deb]/ensure: defined content as '{md5}498cf652c173390c948b384ea751a559'
Notice: /Stage[main]/Nginx-dev/File[/tmp/build-nginx.sh]/ensure: defined content as '{md5}acdf1f5978e0bd05e9bfb10df7ea1b07'
Notice: /Stage[main]/Melt/File[/tmp/build-melt.sh]/ensure: defined content as '{md5}aec40de2c8d09fc00dfbab2173acc662'
Notice: /Stage[main]/Melt/Package[libsamplerate-dev]/ensure: ensure changed 'purged' to 'present'
Notice: /Stage[main]/Melt/Package[libsdl-dev]/ensure: ensure changed 'purged' to 'present'
Notice: /Stage[main]/Melt/File[/tmp/build-melt.conf]/ensure: defined content as '{md5}8312f0bfdfe91d2d8695e9a4e689c870'
Notice: /Stage[main]/Y
LOG: Fri Apr 18 12:37:15 UTC 2014
LOG: ./build-melt.sh starting
LOG: Checking for sudo requirement
LOG: Done checking for sudo requirement
LOG: Number of steps determined to 26
LOG: Process has finished. Reason: ABORTED User requested abort
LOG: Cleaning out all subdirs
LOG: About to run command: cd /home/vagrant/melt/src
LOG: About to run command: cd /home/vagrant/melt/src
LOG: Make clean for vid.stab called
@chrism
chrism / gist:007ec2416789d78da77c
Created September 29, 2014 09:53
ic-ajax for use in a JSBin with var ajax = ic.ajax; ajax.defineFixture & RESTAdapter.
!function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),(f.ic||(f.ic={})).ajax=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
"use strict";
/*!
* ic-ajax
*
* - (c) 2013 Instructure, Inc
* - please see license at https://github.com/instructure/ic-ajax/blob/master/LICENSE
* - inspired by discourse ajax: https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/mixi
@chrism
chrism / index.html
Created October 22, 2014 08:45
// source http://jsbin.com/asuyek/4 Drag & Drop Ember Example
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0-rc.3/handlebars.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/ember.js/1.0.0-rc.1/ember.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
<style id="jsbin-css">
.draggable {
import Ember from 'ember';
export default Ember.Controller.extend({
actions: {
createTodo: function (todoDetails) {
var todoRecord = this.store.createRecord('todo', todoDetails);
var controller = this;
var model = this.get('model');
var todos = model.get('todos').then(function (todos) {