Skip to content

Instantly share code, notes, and snippets.

View megantaylor's full-sized avatar

Megan Taylor megantaylor

View GitHub Profile
# Taps
tap "homebrew/core"
tap "homebrew/bundle"
tap "homebrew/services"
tap "caskroom/cask"
# Binaries
brew "node"
brew "git"
@megantaylor
megantaylor / History|-1020aab0|entries.json
Last active September 20, 2022 16:09
Visual Studio Code Settings Sync Gist
{"version":1,"resource":"file:///Users/megantaylor/Documents/frontend-campaign-landing-pages/src/components/person-screen/voter-registration/InstanceHeader.tsx","entries":[{"id":"ew1Q.tsx","timestamp":1648742002635},{"id":"QCi4.tsx","timestamp":1648742058592}]}
@megantaylor
megantaylor / firstDupe.js
Created June 14, 2018 19:56
find the first recurring character in a string
// 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) {
<!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>
<!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>
<!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>
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
</body>
</html>
@megantaylor
megantaylor / hmph.php
Last active August 29, 2015 14:05
exclude categories from WP home page
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 July 18, 2014 21:33
Get URL parameters
$.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 July 18, 2014 21:32
Calculate the height of the higher column and automatically adjust all other columns to this height.
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/