Skip to content

Instantly share code, notes, and snippets.

View sclaxton's full-sized avatar

Spencer Claxton sclaxton

View GitHub Profile
@sclaxton
sclaxton / 0_reuse_code.js
Created December 16, 2016 07:50
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@sclaxton
sclaxton / -result-list.hbs
Last active December 16, 2016 07:23
Sample implementation sketch for a general, flexible, minimal ember type-ahead implementation
<ul class='result-list'>
{{!-- Want this component to have API parity with ember `each` so it can just --}}
{{!-- be a parent-aware results iterator that can do anything vanilla `each` can. --}}
{{#each key=eachKey results as |result index|}}
{{!-- The `_select` action would call both the `select` action passed by user --}}
{{!-- and the private `_parentSelect` action passed by the parent. --}}
<li class='result-container' {{action '_select'}}>
{{yield result index}}
</li>
{{/each}}
@sclaxton
sclaxton / ember-ide-features.md
Created November 18, 2016 19:39
Ember IDE featurelist brainstorm

Features

Parity with existing ember-cli commands

import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@sclaxton
sclaxton / controllers.application.js
Created November 7, 2016 18:41
Deeply non-existent properties in handlebars
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
queryParams: ['greeting']
});
@sclaxton
sclaxton / application.controller.js
Created February 23, 2016 05:12
Positional Params
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@sclaxton
sclaxton / response.html
Created January 26, 2015 22:54
Response of failure
<!DOCTYPE html>
<html>
<head>
<title>LinkedIn</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
.iframe #header,
.iframe #body,
.iframe #footer,
@sclaxton
sclaxton / li.prf
Last active August 29, 2015 14:13
Automated Unison Sync between Headless Linux and Mac
# Roots of the synchronization
root = ssh://{username}@{username}-ld1/workspace
root = /Users/{username}/workspace
# Paths to synchronize if any
# Some regexps specifying names and paths to ignore
ignore = Name *.*
@sclaxton
sclaxton / javascript-lesson.md
Last active August 29, 2015 14:07
A lesson for a student struggling with their web development assignment

#A Few JavaScript Pointers

###Declaring Variables and Classes In JavaScript

It is really important to follow syntactic conventions to keep your code readable. Variable names should be mixedCase. In addition you should always name variables in a meaningful way. Try to stay away from names like temp or other. Anything that is too vague or non-specific will just make your code really confusing when you look back at it later.

One of the huge uses of variables is that you can name them in such a way that describes what kind of data the variable holds. By reading the variable names throughout your program you can get good idea of what data is being manipulated in different places in your program.

JavaScript is an object oriented language, so we can use objects to model our data after real world things. For example, take people. We can define a class of Person objects and then put the data we have about different people, e.g. their names, into different Person object instances.