Skip to content

Instantly share code, notes, and snippets.

View taniarascia's full-sized avatar
💾

Tania Rascia taniarascia

💾
View GitHub Profile
@taniarascia
taniarascia / facebook.html
Created September 10, 2015 18:15
Meta Facebook post information
<meta property="og:image" content="img.jpg" />
<meta property="og:title" content="Title" />
<meta property="og:description" content="Desc." />
@taniarascia
taniarascia / focus.js
Created September 10, 2015 22:00
Do action onclick AND focus - AKA when pressing tab.
$("#fullname").bind('click keypress keyup change focus', function(){
$("#note_email").fadeIn();
});
$("#fullname").bind('focus', function(){
$("#note_email").fadeIn();
});
OR
@taniarascia
taniarascia / .htaccess
Last active February 13, 2024 07:53
Page Speed Optimization
## Expires
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
@taniarascia
taniarascia / fade.js
Created September 16, 2015 19:03
Fade Items Into View on Scroll
$(window).scroll(function () {
/* Check the location of each desired element */
$('.fade').each(function (i) {
var bottom_of_object = $(this).offset().top + $(this).outerHeight();
var bottom_of_window = $(window).scrollTop() + $(window).height();
/* If the object is completely visible in the window, fade it in */
if (bottom_of_window > bottom_of_object) {
@taniarascia
taniarascia / hover.js
Created September 16, 2015 19:20
Show after hover for period of time
var fadeTimeout;
console.log(fadeTimeout);
$("#menu").hover(function () {
fadeTimeout = setTimeout(showFade, 2000);
},
hideFade);
function showFade() {
var fade = $("<div class='secret-menu'><a href='secret-menu.pdf' style='color:black' >Shhhh! Secret Menu!</a></div>");
fade.appendTo($("#menu"));
@taniarascia
taniarascia / redirect.php
Created September 16, 2015 20:02
PHP Redirect
<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.New-Website.com");
?>
@taniarascia
taniarascia / http-conf
Created September 17, 2015 17:40
Redirect from http conf
ServerName shawsoysterfest.com
ServerAlias www.shawsoysterfest.com
Redirect 301 / http://www.oysterfestchicago.com/
@taniarascia
taniarascia / hover.js
Created September 24, 2015 14:29
Hover Example
var image = document.getElementById("hover-example");
image.onmouseover = function() { image.src = "http://placehold.it/350x150/262626/ffffff"; }
image.onmouseout = function() { image.src = "http://placehold.it/350x150"; }
@taniarascia
taniarascia / header-scroll.js
Created September 30, 2015 16:41
Change Header Color on Scroll
var scroll_start = 0;
var startchange = $('#scroll-color');
var offset = startchange.offset();
$(document).scroll(function () {
scroll_start = $(this).scrollTop();
if (scroll_start > offset.top) {
$('.navigation').css('background', '#e63c2d');
} else {
$('.navigation').css('background', 'transparent');
}
@taniarascia
taniarascia / active.js
Created October 1, 2015 17:57
Active Scroll
var sections = $('section'),
links = $('nav ul li a'),
lis = $('nav ul > li');
$(window).scroll(function() {
var currentPosition = $(this).scrollTop();
links.removeClass('active');
lis.removeClass('active');
sections.each(function() {