Skip to content

Instantly share code, notes, and snippets.

View mikebranski's full-sized avatar

Mike Branski mikebranski

View GitHub Profile

Keybase proof

I hereby claim:

  • I am mikebranski on github.
  • I am mikebranski (https://keybase.io/mikebranski) on keybase.
  • I have a public key whose fingerprint is 9434 DC44 7F8E AF2D 85E0 6761 5BB1 7E64 056B 00F6

To claim this, I am signing this object:

@mikebranski
mikebranski / 00-instructions.md
Last active March 13, 2017 18:15
JavaScript Exercises

Instructions

Create a new JS Bin and solve each challenge, then send it to your mentor for review.

DO NOT leave your answers as comments here.

@mikebranski
mikebranski / thought-process.js
Created February 21, 2017 21:42
Bloc Assignment 11 Solution Flow
// Bloc Frontend Foundation
// Checkpoint 11 Assignment Instructions
//
// Add an event listener to the album cover. When a user clicks it, the album
// page content should toggle between the three album objects: albumPicasso,
// albumMarconi, and your album object.
//
// Okay, I know I'll need a click handler on the big album cover image, so I'll
// start there. The click handler will be very simple to confirm it's working.
@mikebranski
mikebranski / closures-and-scopes.md
Created February 17, 2017 22:40
Bloc JS Closures / Scoping exercises

JS Closures / Scoping exercises

  1. What’s the result of executing this code and why.
function test() {
   console.log(a);
   console.log(foo());
   
   var a = 1;
   function foo() {
@mikebranski
mikebranski / count-the-fives.md
Created February 16, 2017 22:30
JavaScript exercise dealing with arrays

Count The Fives

Explanation: Create a function the takes an Array of numbers and returns an Integer count of the number of 5's in the Array

Bloc Objective: Write a for loop.

Content:

// Create a function the takes an Array of numbers and returns an
// Super swanky pseudo-code that prevents customers like me from losing their support message
// when they fat finger the wrong button and navigate away before they're done.
// Making some assumptions about Simple's code. :D
var Simple = Simple || {};
Simple.confirmLeavingSupportMessage = "Hold up! You'll lose what you started typing if you leave.";
// Checks if the customer has started typing a message to support.
Simple.hasDirtySupportMessageField = function() {
/**
* This Google Sheets script keeps data in the specified column sorted any time
* the data changes.
*
* After much research, there wasn't an easy way to automatically keep a column
* sorted in Google Sheets, and creating a second sheet to act as a "view" to
* my primary one in order to achieve that was not an option. Instead, I
* created a script that watches for when a cell is edited and triggers
* an auto sort.
*
@mikebranski
mikebranski / editor.plugin.zsh
Created March 27, 2015 21:29
oh-my-zsh editor plugin
# Quick shortcut to the specified editor ($EDITOR).
# Adapted from @holman's .dotfiles.
#
# To install:
# Copy script to $ZSH/custom/plugins/editor/editor.plugin.zsh
# Add `editor` to the list of plugins included by oh-my-zsh
#
# If you're not using oh-my-zsh, you can just drop this in your shell profile
# (e.g. ~/.zshrc, ~/.bash_profile, etc)
#
@mikebranski
mikebranski / gist:1226710
Created September 19, 2011 15:08
Nested HTML Lists
<!-- INCORRECT -->
<ul>
<li>First bulleted item</li>
<li>Second bulleted item</li>
<ol>
<li>First nested number</li>
</ol>
</ul>
<!-- CORRECT -->
@mikebranski
mikebranski / gist:73465
Created March 3, 2009 19:16
Layer One - slider examples
$(document).ready(function() {
/*
* Original
*/
$(".sliderContent").addClass("overflowSliderContent");
$(".sliderContent").children().addClass("hiddenSliderContent");
$(".sliderContent").each(function(i) { $($(this).children().get(0)).removeClass("hiddenSliderContent"); });