Skip to content

Instantly share code, notes, and snippets.

View megantaylor's full-sized avatar

Megan Taylor megantaylor

View GitHub Profile
@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 / Facebook Sharer
Created November 7, 2012 15:47
Facebook sharer code with customized description, image and title
<a title="Share this article/post/whatever on Facebook" onclick="return !window.open(this.href, 'Facebook', 'width=640,height=300')" href="http://www.facebook.com/sharer.php?s=100&p[url]=url to share&p[images][0]=the image you want to share&p[title]=the title you want to share&p[summary]=the description/summary you want to share">Share on Facebook</a>
@megantaylor
megantaylor / Twitter Sharer
Created November 7, 2012 15:48
Twitter share code with customized text, via, hashtag
<a href="https://twitter.com/share?url=url to share&amp;via=username&amp;text=This%20will%20show%20up&amp;hashtags=hashtag it up" class="twitter-share-button">Tweet This</a>
@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) {
# Taps
tap "homebrew/core"
tap "homebrew/bundle"
tap "homebrew/services"
tap "caskroom/cask"
# Binaries
brew "node"
brew "git"
@megantaylor
megantaylor / pdfviewer.php
Created April 22, 2013 22:11
PDF viewer shortcode for WordPress
The first step is to paste the following code into your functions.php file:
function pdflink($attr, $content) {
return '<a class="pdf" href="http://docs.google.com/viewer?url=' . $attr['href'] . '">'.$content.'</a>';
}
add_shortcode('pdf', 'pdflink');
Once you saved the file, you'll be able to use the shortcode on your posts and page. Here is the syntax:
[pdf href="http://yoursite.com/linktoyour/file.pdf"]View PDF[/pdf]
<!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>