Skip to content

Instantly share code, notes, and snippets.

View johnmurch's full-sized avatar

John Murch johnmurch

View GitHub Profile
@johnmurch
johnmurch / gist:7090007
Created October 21, 2013 20:03
One of the Best Cold Emails I've EVER Received - Noah Kagan
I get at least 2 emails a day asking for coffee or advice.
Lately, I've been deleting them because no one takes even a minute to write a well crafted email.
I used to feel guilty but I figure since the person is being selfish, I can be as well.
A few days ago I got a surprising email from Dave Daily.
BLEW MY MIND.
@johnmurch
johnmurch / gist:8816834
Created February 5, 2014 03:06
CSS Media Queries
@media (min-width:320px) { /* smartphones, iPhone, portrait 480x320 phones */ }
@media (min-width:481px) { /* portrait e-readers (Nook/Kindle), smaller tablets @ 600 or @ 640 wide. */ }
@media (min-width:641px) { /* portrait tablets, portrait iPad, landscape e-readers, landscape 800x480 or 854x480 phones */ }
@media (min-width:961px) { /* tablet, landscape iPad, lo-res laptops ands desktops */ }
@media (min-width:1025px) { /* big landscape tablets, laptops, and desktops */ }
@media (min-width:1281px) { /* hi-res laptops and desktops */ }
@johnmurch
johnmurch / gist:7c875eac500752c20c7b
Last active November 14, 2016 15:42
Bootstrap 3 + jQuery CDN HTML Template
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Test</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link media="all" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link media="all" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<style>
@johnmurch
johnmurch / months.js
Last active August 29, 2015 14:13
Print Friendly Javascript (JS) Date - Leading Zeros
var mL = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
var mS = ['Jan', 'Feb', 'March', 'April', 'May', 'June', 'July', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec'];
console.log(mL[2]); // March
console.log(mL[7]); // Aug
@johnmurch
johnmurch / confirm.js
Last active August 29, 2015 14:13
JavaScript Confirm Modal using Bootstrap 3
$(document).ready(function() {
$('a[data-confirm]').click(function(ev) {
var href = $(this).attr('href');
if (!$('#dataConfirmModal').length) {
$('body').append('<div id="dataConfirmModal" class="modal fade" role="dialog" tabindex="-1" aria-labelledby="dataConfirmLabel" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button><h3 id="dataConfirmLabel">Please Confirm</h3></div><div class="modal-body"></div><div class="modal-footer"><button class="btn" style="margin-top:10px;" data-dismiss="modal" aria-hidden="true">Cancel</button><a class="btn btn-danger" id="dataConfirmOK">YES</a></div></div></div></div>');
}
$('#dataConfirmModal').find('.modal-body').text($(this).attr('data-confirm'));
$('#dataConfirmOK').attr('href', href);
$('#dataConfirmModal').modal({show:true});
return false;
@johnmurch
johnmurch / fontawesome-icons.js
Created February 24, 2015 14:58
Font Awesome icon Names [Array] - v4.3.0
[
"fa-adjust",
"fa-adn",
"fa-align-center",
"fa-align-justify",
"fa-align-left",
"fa-align-right",
"fa-ambulance",
"fa-anchor",
"fa-android",
@johnmurch
johnmurch / getHighlight.html
Last active August 29, 2015 14:20
Capture Highlighted Text
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>TEST</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
</head>
<body>
<div>Sample Title</div>
<pre>
@johnmurch
johnmurch / excel2date.js
Last active August 29, 2015 14:23
Excel Date to Javascript
function ExcelDateToJSDate(date) {
return new Date((date - (25567 + 1))*86400*1000);
}
$(document).ready(function(){
autoPlayYouTubeModal();
});
@johnmurch
johnmurch / placeholder.html
Created July 2, 2015 20:43
Show Placeholder after focus
<input type="text" class="input-box" id="Zipcode" placeholder="Enter Zipcode" onblur="if(this.value == '') { this.style.color='#000'; this.value='Enter Zipcode'}" onfocus="if (this.value == 'Enter Zipcode') {this.style.color='#000'; this.value=''}">