Skip to content

Instantly share code, notes, and snippets.

View Takaya213's full-sized avatar
🎯
Focusing

Nicole Lambon Takaya213

🎯
Focusing
View GitHub Profile
@Takaya213
Takaya213 / flex-full-width-nav-css2.css
Created August 19, 2015 08:07
Equally Spaced, Variable-Width Navigation Links
ul {
display: table;
width: 100%;
}
li {
display: table-cell;
}
a {
@Takaya213
Takaya213 / show-hide-search.js
Created March 13, 2015 06:13
Display Search and Hide it on anywhere click
// Header Search
$('.search a').on('click', function(event){
event.preventDefault();
var search = $(this).attr('href');
$(search).css('right', '0');
});
// Hide search on document click
$(document).mouseup(function(e){
<ifModule mod_headers.c>
# Turn on Expires and set default expires to 3 days
ExpiresActive On
ExpiresDefault A259200
 
# Set up caching on media files for 1 month
<filesMatch ".(ico|gif|jpg|jpeg|png|flv|pdf|swf|mov|mp3|wmv|ppt)$">
ExpiresDefault A2419200
Header append Cache-Control "public"
</filesMatch>
@Takaya213
Takaya213 / Redirect a single page
Created September 12, 2014 06:05
301 Redirects
Redirect 301 /oldpage.html http://www.yoursite.com/newpage.html
Redirect 301 /oldpage2.html http://www.yoursite.com/folder/
@Takaya213
Takaya213 / character-limiter.js
Created April 9, 2014 07:21
Character Limiter
(function($) {
$.fn.extend( {
limiter: function(limit, elem) {
$(this).on("keyup focus", function() {
setCount(this, elem);
});
function setCount(src, elem) {
var chars = src.value.length;
if (chars > limit) {
src.value = src.value.substr(0, limit);
@Takaya213
Takaya213 / equal-height-rows.css
Created April 9, 2014 07:06
Responsive Equal Height Rows
article {
float: left;
width: 23%;
background: #ccc;
margin: 10px 1%;
padding: 1%;
}
@media all and (max-width: 900px) {
article {
@Takaya213
Takaya213 / responsive-table.css
Last active October 6, 2016 08:08
Responsive Tables
table#miyazaki {
margin: 0 auto;
border-collapse: collapse;
font-family: Agenda-Light, sans-serif;
font-weight: 100;
background: #333; color: #fff;
text-rendering: optimizeLegibility;
border-radius: 5px;
}
@Takaya213
Takaya213 / scroll-to-top.js
Last active May 3, 2017 10:01
Show and hide a scroll to top of page button, depending on where you are on the page.
$(window).scroll(function() {
if ($(this).scrollTop()) {
$('#toTop:hidden').stop(true, true).fadeIn();
} else {
$('#toTop').stop(true, true).fadeOut();
}
});
$(document).ready(function(){
$('#toTop').fadeOut();