Skip to content

Instantly share code, notes, and snippets.

View Samsinite's full-sized avatar

Sam Clopton Samsinite

View GitHub Profile

Keybase proof

I hereby claim:

  • I am Samsinite on github.
  • I am samsinite ( on keybase.
  • I have a public key whose fingerprint is C8E5 D10B 6AD3 9382 39AE B3D8 43FB 2937 B6CD F09E

To claim this, I am signing this object:

View builder object wrapper
class FooController
include ApiMe
model FooService
class FooService
def initialize(*args)
@foo =*args)
Samsinite / application.hbs
Created May 16, 2015 21:30
Basic Application Layout
View application.hbs
<nav id="top-nav">
<h1>Ember Fit</h1>
<nav id="side-nav">
<li><a id="ember418" class="ember-view" href="/"><i class="fa fa-calendar icon"></i>Scheduler</a></li>
<li><a id="ember419" class="ember-view" href="/stop-watch"><i class="fa fa-clock-o icon"></i>Stop Watch</a></li>
<li><a id="ember420" class="ember-view active" href="/workout-builder/index"><i class="fa fa-plus-square icon"></i>Workout Builder</a></li>
View stop-watch.hbs
<div id="stop-watch">
<div class="timer-wrapper">
<div class="button-wrapper">
<button class="btn btn-primary" data-ember-action="1006">Start</button>
<button class="btn btn-primary" data-ember-action="1007" disabled="">Stop</button>
<button class="btn btn-danger" data-ember-action="1008">Reset</button>
Samsinite / stop-watch.js
Last active August 29, 2015 14:21
Some Stop Watch Code
View stop-watch.js
import Ember from 'ember';
import moment from 'moment';
const { setProperties } = Ember;
export default Ember.Controller.extend({
isRunning: false,
startDisabled: Ember.computed.alias('isRunning'),
stopDisabled: Ember.computed.not('startDisabled'),
cachedDuration: null,
Samsinite / pad-number.js
Created May 17, 2015 19:21
Pad Number Helper
View pad-number.js
import Ember from 'ember';
export function padNumber(params/*, hash*/) {
var str = params[0] + "";
var size = params[1];
while (str.length < size) {
str = "0" + str;
Samsinite / index.hbs
Created May 17, 2015 19:55
Workout Index List Markup
View index.hbs
<div id="workout-builder">
<div id="workout-builder-index">
<a id="ember986" class="btn btn-primary">New</a>
<table class="table table-striped table-hover">
Samsinite / application.js
Created May 17, 2015 21:37
LF Serializer
View application.js
import LFSerializer from 'ember-localforage-adapter/serializers/localforage';
export default LFSerializer;
Samsinite / bootstrap-input.hbs
Last active August 29, 2015 14:21
bootstrap select compoent
View bootstrap-input.hbs
<!-- app/templates/components/bootstrap-input.hbs -->
<label for="{{inputId}}">{{label}}</label>
{{input value=value placeholder=placeholder elementId=inputId classNames="form-control"}}
Samsinite / sortable-array-proxy.js
Created July 6, 2015 21:57
Ember sortable array proxy
View sortable-array-proxy.js
import Ember from 'ember';
var SortableArrayProxy = Ember.ArrayProxy.extend(Ember.SortableMixin);
export function createSortableArray(arrayToProxy, sortProperties, sortAscending) {
return SortableArrayProxy.create({
content: arrayToProxy,
sortProperties: sortProperties,
sortAscending: sortAscending