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 (https://keybase.io/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:

class FooController
include ApiMe
model FooService
end
class FooService
def initialize(*args)
@foo = Foo.new(*args)
end
@Samsinite
Samsinite / application.hbs
Created May 16, 2015 21:30
Basic Application Layout
<nav id="top-nav">
<h1>Ember Fit</h1>
</nav>
<nav id="side-nav">
<ul>
<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>
</ul>
</nav>
<div id="stop-watch">
<div class="timer-wrapper">
00:00:00:000
</div>
<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>
</div>
</div>
@Samsinite
Samsinite / stop-watch.js
Last active August 29, 2015 14:21
Some Stop Watch Code
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
Samsinite / pad-number.js
Created May 17, 2015 19:21
Pad Number Helper
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
Samsinite / index.hbs
Created May 17, 2015 19:55
Workout Index List Markup
<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">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th></th>
</tr>
@Samsinite
Samsinite / application.js
Created May 17, 2015 21:37
LF Serializer
import LFSerializer from 'ember-localforage-adapter/serializers/localforage';
export default LFSerializer;
@Samsinite
Samsinite / bootstrap-input.hbs
Last active August 29, 2015 14:21
bootstrap select compoent
<!-- app/templates/components/bootstrap-input.hbs -->
<label for="{{inputId}}">{{label}}</label>
{{input value=value placeholder=placeholder elementId=inputId classNames="form-control"}}
@Samsinite
Samsinite / sortable-array-proxy.js
Created July 6, 2015 21:57
Ember sortable array proxy
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
});