Skip to content

Instantly share code, notes, and snippets.

@hartleybrody
hartleybrody / new-tab.js
Last active December 15, 2015 17:19
Open all links on a page in a new window, assuming jQuery is mapped to the $ sign. Useful for when I want to leave a page open (ie, GitHub dashboard) and not have to constantly be reaching for my bookmarks.
$('a').each( function(index, item){
item.target = '_blank';
});
@hartleybrody
hartleybrody / 0_reuse_code.js
Created April 2, 2014 15:50
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@hartleybrody
hartleybrody / Bitwise Operators.md
Last active August 29, 2015 13:57
While learning about XORs during a basic crypto class, I decided to take a side track and learn about a term that was always shrouded in mystery -- bitwise operators. As always, I wrote these as my own notes for later reference but I'm publishing them here in case they help other people. Happy to accept pull requests for corrections.

(A bit of a tangent from crypto 101)

Bits and bytes

  • Core contepts:

    • Bitwise operators work on bits.
    • Bits are used to express data in binary form.
    • Bits can have a value of either 1 (ie TRUE) or 0 (ie FALSE).
  • Higher-level language constructs like floats and strings can all be represented as a series of bytes

  • 1 byte = 8 bits