Skip to content

Instantly share code, notes, and snippets.

View slindberg's full-sized avatar
💭
I'm a mechanical engineer now

Steven Lindberg slindberg

💭
I'm a mechanical engineer now
View GitHub Profile
@slindberg
slindberg / ember-data.dependent-relations.js
Last active November 5, 2021 21:41
Dependent Relationships in Ember Data
/**
Ember Data: Dependent Relationships
This package extends Ember Data to support creating relationships
where a model's dirty state depends not only on its own attributes
but on the dirty state of models in dependent relationships as well.
```javascript
App.Thing = DS.Model.extend({
name : DS.attr('string'),
@slindberg
slindberg / README.md
Last active August 29, 2015 13:56
Model 'Fragments' in Ember Data
@slindberg
slindberg / if-all-exists.js
Last active August 29, 2015 13:57
Bound conditional Handlebars helpers for Ember
import ifConditionHelper from 'myapp/helpers/if-condition';
/**
* Logical AND Existence Conditional Block
*
* Usage: {{#if-all-exists field1 field2}}Either field1 or field2 is truthy{{/if-all-exists}}
*
* Executes the given block if all arguments are defined
*/
export default function() {

Keybase proof

I hereby claim:

  • I am slindberg on github.
  • I am slindberg (https://keybase.io/slindberg) on keybase.
  • I have a public key whose fingerprint is B8DE 7D75 20BF AE0F 4BBF 5301 B3D8 0328 DA30 4283

To claim this, I am signing this object:

@slindberg
slindberg / app_templates_components_form-control.hbs
Last active December 8, 2016 03:19
Two-way bindings and the `mut` helper in Ember
<div class="form-control">
<label>{{attrs.label}}</label>
{{! Since mutable attributes are now wrapped, this will no longer work :( }}
{{input value=attrs.value}}
{{! Instead, we need to leverage some kind of event... }}
{{input value=attrs.value.value key-up=attrs.value.update}}
{{! Or, forgo two-way bindings and the `input` helper altogether, which forces us to create an explicit action... }}
@slindberg
slindberg / awesome_face.nc
Last active December 31, 2016 03:34
G-code for drawing an awesome face on a 3-axis CNC
%
(Modal reset)
G0 G90 G17 G40 H0 G70 G80
(Tool change - black sharpie)
G53 Z0.0
M06 T1
M19
G54 X0.0 Y0.0
G0 Z0.25 H1