Skip to content

Instantly share code, notes, and snippets.

View lisaychuang's full-sized avatar

Lisa Huang-North lisaychuang

View GitHub Profile
@lisaychuang
lisaychuang / Lisa-Huang-North.md
Last active July 9, 2019 06:22
Lisa Huang-North's resume

Lisa Huang-North | Frontend Software Engineer

Skills & Tools

  • Languages: JavaScript (ES6), HTML5, CSS3, Ruby
  • Framework & Library: JQuery, AJAX, Node.js, EmberJS, ReactJS, Bootstrap 4, Grid, Media Query, RESTful API, Heroku, Netlify, Mocha, Chai
  • Database: SQL
  • Methodologies: Agile Development, Responsive Design, Wireframe, Object-Oriented Programming, MVC, Test-Driven Development, Authentication, JSON
@lisaychuang
lisaychuang / game.js
Created April 1, 2019 00:09
Ember Octane Hangman - numWrongGuesses() getter function
get numWrongGuesses() {
let count = 0;
const uWord = this.word.toUpperCase();
this.guesses.forEach(guess => {
if (uWord.indexOf(guess) < 0) count++;
});
return count;
}
@lisaychuang
lisaychuang / game.js
Created April 1, 2019 00:08
Ember Octane Hangman - wordWithBlanks() getter function
get wordWithBlanks() {
const chars = [];
for (let i = 0; i < this.args.word.length; i++) {
const char = this.args.word[i];
if (this.guesses.indexOf(char.toUpperCase()) >= 0) chars.push(char);
else chars.push("_");
}
return chars.join("").toUpperCase(); // _IS_ in video stream example
}
@lisaychuang
lisaychuang / game.js
Created March 31, 2019 04:33
Ember Octane Hangman component - final solution
import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
import { action } from '@ember/object';
export default class GameComponent extends Component {
@tracked
guessString = '';
// using action decorator on our event listener
@action
@lisaychuang
lisaychuang / random-word.js
Created March 31, 2019 04:20
Ember Octane Hangman random-word helper
import { helper } from '@ember/component/helper';
const WORDS = ['Apple', 'Pear', 'Orange', 'Tomato', 'Kumquat', 'Jackfruit'];
export function randomWord() {
const idx = Math.round(Math.random() * WORDS.length);
return WORDS[idx];
}
export default helper(randomWord);
@lisaychuang
lisaychuang / game.hbs
Last active March 30, 2019 23:30
Ember Octane Hangman SVG - IF and UNLESS helpers
<svg height="400" width="400" class="hangman {{if this.isDead "dead" ""}}">
<g id="body">
{{#if this.showRope}}
<line id="rope" x1="200" y1="20" x2="200" y2="60" />
{{/if}}
{{#if this.showHead}}
<g id="head">
<circle cx="200" cy="80" r="20" stroke="black" stroke-width="4" fill="white" />
@lisaychuang
lisaychuang / game.js
Last active March 30, 2019 23:01
Ember Octane Hangman component - action helper
import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
import { action } from '@ember/object';
export default class GameComponent extends Component {
@tracked
guessString = 'ZYX';
// using action decorator on our event listener
@action
@lisaychuang
lisaychuang / game.hbs
Created March 30, 2019 06:39
Ember Octane Hangman SVG - IF helpers
<svg height="400" width="400" class="hangman">
<g id="body">
{{#if this.showRope}}
<line id="rope" x1="200" y1="20" x2="200" y2="60" />
{{/if}}
{{#if this.showHead}}
<g id="head">
<circle cx="200" cy="80" r="20" stroke="black" stroke-width="4" fill="white" />
@lisaychuang
lisaychuang / game.js
Last active March 30, 2019 23:01
Ember Octane Hangman component - getter functions
import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
export default class GameComponent extends Component {
@tracked
guesses = ["I", "S"];
@tracked
word = "Lisa";
@lisaychuang
lisaychuang / game.hbs
Last active March 30, 2019 06:34
Ember Octane Hangman SVG - wordWithBlanks
<svg height="400" width="400" class="hangman">
<g id="body">
<line id="rope" x1="200" y1="20" x2="200" y2="60" />
<g id="head">
<circle cx="200" cy="80" r="20" stroke="black" stroke-width="4" fill="white" />
<g id="rEyes">
<circle cx="193" cy="80" r="4" />
<circle cx="207" cy="80" r="4" />