Skip to content

Instantly share code, notes, and snippets.

Avatar

Mike Branski mikebranski

View GitHub Profile
View keybase.md

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 Mar 13, 2017
JavaScript Exercises
View 00-instructions.md

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 Feb 21, 2017
Bloc Assignment 11 Solution Flow
View thought-process.js
// 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 Feb 17, 2017
Bloc JS Closures / Scoping exercises
View closures-and-scopes.md

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 Feb 16, 2017
JavaScript exercise dealing with arrays
View count-the-fives.md

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
View simple-confirm-leaving-support.js
// 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() {
View Keep Column Sorted in Google Sheets.gs
/**
* 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 Mar 27, 2015
oh-my-zsh editor plugin
View editor.plugin.zsh
# 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)
#
View gist:1226710
<!-- 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 Mar 3, 2009
Layer One - slider examples
View gist:73465
$(document).ready(function() {
/*
* Original
*/
$(".sliderContent").addClass("overflowSliderContent");
$(".sliderContent").children().addClass("hiddenSliderContent");
$(".sliderContent").each(function(i) { $($(this).children().get(0)).removeClass("hiddenSliderContent"); });