Skip to content

Instantly share code, notes, and snippets.

View LoganArnett's full-sized avatar

Logan Arnett LoganArnett

View GitHub Profile
@LoganArnett
LoganArnett / main.md
Created November 17, 2016 13:50
Terraform Import Helpers

NOTE: Currently all of these require going through these collections that are returned and wrapping them in an Object.

Parse Tags in Resources

This helps to just get the cleaned up tags from the imported format in the console

const tags = [Array of Tag Objects];
tags.forEach(parseTags);

function parseTags(tag) {
	var result = 'tags {\n';
@LoganArnett
LoganArnett / main.md
Last active November 16, 2016 21:20
Front End Questions

Front End Questions

  1. Closure: In the code snippet you sent below the approach is clear but you have run into something called Closure. What you are attempting to do here is to create a different environment for each onclick event so that we alert() a different message, however, because of the created closure we are actually telling our 3 buttons to share the parent environment. This means that by the time any of our buttons are clicked the loop has completed reaches an index of 3 which is undefined in our array of strings since arrays are zero indexed in javascript.

You should research a little about Closures and see if you can identify how to create a unique environment for each button.

<button id="btn-0">Button 1!</button>
<button id="btn-1">Button 2!</button>
<button id="btn-2">Button 3!</button>
@LoganArnett
LoganArnett / $stateParamsUsers.html
Created March 17, 2015 19:14
Basic $stateParams intro for TIY Students
<!--This will be available at the
url: /users/:id(or {id}) where id is the
hash or directory that you dynamically set-->
<section id="users">
<div>
<h2>{{users.userInfo.name}}</h2>
<p>{{users.userInfo.email}}</p>
<p>{{users.userInfo.age}}</p>
</div>
@LoganArnett
LoganArnett / LoginFire.html
Created March 12, 2015 19:23
Login Demo Firebase
<div class="login">
<button class="btn btn-info col-xs-12" ng-click="app.twitLogin()">Twitter</button>
<button class="btn btn-primary col-xs-12" ng-click="app.fbLogin()">Facebook</button>
<button class="btn btn-success col-xs-12" ng-click="app.ghLogin()">Github</button>
<button class="btn btn-danger col-xs-12" ng-click="app.logout()">Logout</button>
</div>
@LoganArnett
LoganArnett / index.html
Last active August 29, 2015 14:16
Basic Firebase Demo with '1.0.0' update
<!doctype html>
<html class="no-js" ng-app="randomInfo">
<head>
<meta charset="utf-8">
<title>randomInfo</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
<!-- build:css({.tmp/serve,src}) styles/vendor.css -->
@LoganArnett
LoganArnett / ano.controller.js
Created March 6, 2015 21:07
Basic Routing Demo for UI-Router
'use strict'
angular.module('routeApp')
.controller('AnoCtrl', function(){
console.log('Goodbye');
})
Main Controller
===============
var user = $firebase(Firebase
.child('users')
.child(authdUser.facebook.id)
).$asObject();
angular.extend(user, {
uid: authdUser.facebook.id,
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" href="24--Product-Grid.css">
</head>
<body>
<div id="container">
@LoganArnett
LoganArnett / chessboardissues.md
Last active August 29, 2015 14:07
Working through the Javascript Chessboard

Chessboard Interface

  • @constructor Chess: Setup a board with Pieces representing an initial chessboard.
    • @method getPlayer()
      • @return String either "white" or "black" representing current player
    • @method move(piece, destination): Move piece to destination and...?
      • @param Piece piece to move
      • @param Position destination to move piece to
    • @method opening(): Advance the board to Catalan Opening, Closed Variation
  • @method display()