Skip to content

Instantly share code, notes, and snippets.

Megan Taylor megantaylor

Block or report user

Report or block megantaylor

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View brewfile
# Taps
tap "homebrew/core"
tap "homebrew/bundle"
tap "homebrew/services"
tap "caskroom/cask"
# Binaries
brew "node"
brew "git"
@megantaylor
megantaylor / cloudSettings
Last active Jul 31, 2019
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2019-07-31T14:00:47.789Z","extensionVersion":"v3.4.1"}
@megantaylor
megantaylor / firstDupe.js
Created Jun 14, 2018
find the first recurring character in a string
View firstDupe.js
// Given a string, return the first recurring character in it, or null if there is no recurring chracter. For example, given the string "acbbac", return "b". Given the string "abcdef", return null.
const arr = "acbbac".split("");
const arr2 = "abcdef".split("");
function findFirstDuplicate(arr){
let item = null;
for (var i = 0; i < arr.length; i++) {
if (arr.indexOf(arr[i]) !== i) {
View index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Street Fighter Clone</title>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/main.css">
<script src="http://code.jquery.com/jquery.min.js"></script>
<script src="js/app.js"></script>
View index.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Button Game</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
</head>
<body>
View index.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Button Game</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
</head>
<body>
View index.html
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
</body>
</html>
@megantaylor
megantaylor / hmph.php
Last active Aug 29, 2015
exclude categories from WP home page
View hmph.php
in functions.php file
<?php
add_filter( 'pre_get_posts', function ( $query ) {
if ( $query->is_home() && $query->is_main_query() ) {
$example_term = get_term_by( 'name', 'featured', 'category' );
$example_term_2 = get_term_by( 'name', 'Featured Post', 'category' );
$example_term_3 = get_term_by( 'name', '1,000 Stories', 'category' );
$example_term_4 = get_term_by( 'name', '1,000 Stories Spotlight', 'category' );
$query->set( 'category__not_in', $example_term->term_id, $example_term_2->term_id, $example_term_3->term_id, $example_term_4->term_id );
@megantaylor
megantaylor / urlParam
Created Jul 18, 2014
Get URL parameters
View urlParam
$.urlParam = function(name){
var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href);
if (!results) { return 0; }
return results[1] || 0;
}
//http://snipplr.com/view/26662
@megantaylor
megantaylor / colHeight
Created Jul 18, 2014
Calculate the height of the higher column and automatically adjust all other columns to this height.
View colHeight
var max_height = 0;
$("div.col").each(function(){
if ($(this).height() > max_height) { max_height = $(this).height(); }
});
$("div.col").height(max_height);
//http://web.enavu.com/tutorials/top-10-jquery-snippets-including-jquery-1-4/
You can’t perform that action at this time.