Skip to content

Instantly share code, notes, and snippets.

View tylucaskelley's full-sized avatar
🐢
turtle-y enough 4 the turtle club

Ty-Lucas Kelley tylucaskelley

🐢
turtle-y enough 4 the turtle club
View GitHub Profile
@tylucaskelley
tylucaskelley / ip.sh
Created September 9, 2014 16:19
Get your IP address on Mac and Linux
alias ip="ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1'"
@tylucaskelley
tylucaskelley / kill_indexing.sh
Created September 24, 2014 21:03
Kill spotlight indexing on Mac OS
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

Keybase proof

I hereby claim:

  • I am tylucaskelley on github.
  • I am tylucaskelley (https://keybase.io/tylucaskelley) on keybase.
  • I have a public key whose fingerprint is 202A A4D5 D060 A92F 7847 B598 1A02 5C19 B5AD F824

To claim this, I am signing this object:

@tylucaskelley
tylucaskelley / file_fix.sh
Created November 18, 2014 01:56
Fix chrome file dialog on mac 10.10
defaults delete com.google.Chrome NSNavPanelExpandedSizeForOpenMode
@tylucaskelley
tylucaskelley / cert.html
Created April 14, 2015 18:03
HubSpot Design Certification
<!-- Begin: HubSpot Academy - HubSpot Design Certification Badge -->
<div class='cos-certification-badge'>
<a href='http://academy.hubspot.com/certification' title='HubSpot Inbound Marketing Certification'>
<img src='//app.hubspot.com/academy-certification/badge-image/69793c8d937743c180ce0c43c7be2d80/' />
</a>
</div>
<!-- End: HubSpot Academy - HubSpot Design Certification Badge -->
@tylucaskelley
tylucaskelley / utilities.js
Created October 11, 2015 21:04
Udacity jQuery Webcast: Examples of Using the "$" function
$(document).ready(function() { // ensure jQuery is loaded before doing anything
// iterate over an array
$.each([1, 2, 3, 4], function(index, value) {
console.log( index + ": " + value );
});
// parse a JSON-formatted string and return a JS object
var obj = $.parseJSON('{ "first_name": "Ty-Lucas", "last_name": "Kelley" }');
// get some JSON from an API
@tylucaskelley
tylucaskelley / selection.js
Last active October 11, 2015 21:46
Udacity jQuery Webcast: Examples of Using "$()"
$(document).ready(function() { // just like before, it's good practice to wrap your code in this callback function
// we can select elements by tag name
var $body = $("body");
// this creates what is called a "jQuery object", which comes with a
// ton of convenience methods for DOM manipulation. Here's one:
$body.css("color", "white");
// we can also look for elements using a combination of tag name, class, and ID
var $title = $("h1.title");
@tylucaskelley
tylucaskelley / sizzle.js
Last active October 11, 2015 22:21
Udacity jQuery Webcast: When Does Sizzle Get Used?
$(document).ready(function() {
// Sizzle is jQuery's internal library for DOM element selection. When does it actually get used?
// modern browser, i.e. Chrome, Firefox, Safari, IE 8+, Edge
$("#title"); // Nope! --> document.getElementById("title");
$(".my-class") // Nope! --> document.getElementsByClassName("my-class");
$("body > div.foo #element"); // Nope! --> document.querySelectorAll("body > div.foo #element");
@tylucaskelley
tylucaskelley / sizzle-explanation.js
Last active October 12, 2015 00:46
Udacity jQuery Webcast: How Sizzle Works Internally
// Let's say you give this to jQuery on a browser that doesn't support the selectors API
var $element = $(".title p");
// First, Sizzle will break up the query into an array of selectors:
[".title", "p"]
// You might think that Sizzle will go left to right to find our elements!
// Actually, it does the opposite; Sizzle will first try to find all of the "a" tags,
// using it's "find" method.
@tylucaskelley
tylucaskelley / .gitbotrc
Created November 16, 2016 04:33
Sample Gitbot config file
hooks:
pre-commit:
- eslint
- npmtests
commit-msg:
- enforecaps