Skip to content

Instantly share code, notes, and snippets.

View mbuttler's full-sized avatar

Matthew Buttler mbuttler

  • Ottawa, ON
View GitHub Profile
@mbuttler
mbuttler / JustAGist
Last active December 22, 2015 17:59
Get the gist of it!
This is my first gist. It's pretty cool.
I don't think the queen is an animal.
Here's a bunch of edits that I made.
This is really cool.
Ain't nothin' but a guru thing, baby.
Two escalations make me crazy.
I've got my mind on my tickets, and my tickets on my mind.
var compare = function(choice1,choice2)
{
if (choice1 === choice2) {
return "The result is a tie!";
}
else if (choice1 === "rock") {
if(choice2 ==="scissors") {
var isEven = function(number) {
// Your code goes here!
if (number % 2 === 0)
return true;
else
return false;
};
@mbuttler
mbuttler / friends-and-enemies
Last active August 29, 2015 14:22
Matt's Javascript Question of the Day
// behold, an object.
var neutralFolk = {};
// when I go to check this, I get an "unexpected token ." syntax error. Why?
var enemies = {
enemies.khan = {};
enemies.salazar = {};
@mbuttler
mbuttler / gist:84d850586c1a718aa9b6
Created June 3, 2015 14:37
Matt doesn't really know functions that well yet.
// First we define zee objects...
var friends = {
bill: {
firstName: "Bill",
lastName: "Grates",
number: "613-555-7310",
address: ['123 Any Street', 'Ottawa, ON', 'K2P 1Y8'] },
steve: {
firstName: "Steve",
lastName: "Jerbs",
@mbuttler
mbuttler / gist:b45dd4a736a4aadc6fac
Last active August 29, 2015 14:23
Matt's jQuery question 6/16
// So here's my jQuery script.
$(document).ready(function(){
$("#one").after("<p>Awesome funtimes for all!</p>");
$("#two").after($("p"));
$("p").remove();
});
//how does it know that by "p" I mean my paragraph? I don't declare it as a variable...
// but it still moves it after #two and removes it... why is that?
app.controller('MainController', ['$scope', function($scope) {
$scope.exercises = [
{
icon: 'img/pushup.jpg',
name: 'Pushups',
count: 20
},
{
icon: 'img/squat.jpg',
name: 'Squats',
<!doctype html>
<html>
<head>
<link href="https://s3.amazonaws.com/codecademy-content/projects/bootstrap.min.css" rel="stylesheet" />
<link href='https://fonts.googleapis.com/css?family=Oswald:400,700' rel='stylesheet' type='text/css'>
<link href="css/main.css" rel="stylesheet" />
<script src="js/vendor/angular.min.js"></script>
</head>
<body ng-app="MoveLogApp">
<div class="header">
@mbuttler
mbuttler / MainController.js
Created August 6, 2015 19:20
MainController.js in Built-in and Custom Directives
app.controller('MainController', ['$scope', function($scope) {
$scope.move = {
icon: 'img/move.jpg',
title: 'MOVE',
developer: 'MOVE, Inc.',
price: 0.99
};
$scope.shutterbugg = {
icon: 'img/shutterbugg.jpg',
@mbuttler
mbuttler / index.html
Created August 6, 2015 19:22
index.html in Built-in and Custom Directives
<!doctype html>
<html>
<head>
<link href="https://s3.amazonaws.com/codecademy-content/projects/bootstrap.min.css" rel="stylesheet" />
<link href="css/main.css" rel="stylesheet" />
<!-- Include the AngularJS library -->
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.5/angular.min.js"></script>
</head>
<body ng-app="AppMarketApp">