By consolidating HTML templates, CSS stylesheets, and JavaScript, we can greatly reduce the amount of time spent waiting for requests to retrieve external resources and make transitions between routes appear much smoother.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dontShow(badWord) { | |
$(".thing").each(function(){ | |
var $parent = $(this); | |
var title = $parent.children(".entry").children(".title").children("a").html(); | |
if (title && title.indexOf(badWord) > 0) { | |
console.log(title); | |
$parent.hide(); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerName myserver.com | |
ServerAlias www.myserver.com | |
ProxyRequests off | |
<Proxy *> | |
Order deny,allow | |
Allow from all | |
</Proxy> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Credit to sissi_lauty for this algorithm | |
Original: http://stackoverflow.com/a/15077476 | |
""" | |
from math import sqrt | |
def similarity(x, y): | |
# find length of shorter of the two strings | |
n=min(len(x), len(y)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Credit to CSS-Tricks.com ~ https://css-tricks.com/copy-paste-the-web/ | |
*/ | |
$('#ta').on("focus", function(e) { | |
e.target.select(); | |
$(e.target).one('mouseup', function(e) { | |
e.preventDefault(); | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var promiser = function (callback) { | |
var promise = new Promise(function(resolve, reject){ | |
console.log("Promise created"); | |
window.setTimeout(function(){ | |
resolve("Hello from Promise Land"); | |
}, 3000); | |
}); | |
promise.then(function(){ | |
callback(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime, timedelta | |
from sets import Set | |
import argparse | |
import sys | |
import os | |
import time | |
import shutil | |
import re |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerAdmin [email protected] | |
ServerName dev.mydomain.com | |
ProxyPreserveHost On | |
# setup the proxy | |
<Proxy *> | |
Order allow,deny | |
Allow from all | |
</Proxy> |
A Pen by Craig Palermo on CodePen.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ls /etc/apache2/sites-enabled/* | xargs cat | grep ServerName | uniq |