This file contains 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
// Return 1-based-index of an element in relation to like tags | |
function indexOfType(element) { | |
var prev = element.prevAll(element[0].tagName); | |
if ( empty(prev) ){ | |
return 1; // For 1 indexing | |
} | |
else return 1 + prev.length; | |
} |
This file contains 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
/*! | |
* jQuery Cookie Plugin v1.3.1 | |
* https://github.com/carhartl/jquery-cookie | |
* | |
* Copyright 2013 Klaus Hartl | |
* Released under the MIT license | |
*/ | |
(function (factory) { | |
if (typeof define === 'function' && define.amd) { | |
// AMD. Register as anonymous module. |
This file contains 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
$root = "http://".$_SERVER['HTTP_HOST']; | |
$root .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']); | |
$config['base_url'] = "$root"; |
This file contains 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
<?php | |
// Not currently working. | |
// Example Output | |
/* | |
https://api.followerwonk.com/social-authority?screen_name=randfish;AccessID=member-NTFhMjQxOTQtYTcwNi01YzI4LTk0OTYtZDZlY mRlYzJiMjVk;Timestamp=1368728186;Signature=S97mqDTS0qngjKR41hPhdO4BHpE%3D | |
"401 Unauthorized" | |
*/ |
This file contains 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
<script type="text/javascript"> | |
function fbs_click(width, height) { | |
var leftPosition, topPosition; | |
//Allow for borders. | |
leftPosition = (window.screen.width / 2) - ((width / 2) + 10); | |
//Allow for title and status bars. | |
topPosition = (window.screen.height / 2) - ((height / 2) + 50); | |
var windowFeatures = "status=no,height=" + height + ",width=" + width + ",resizable=yes,left=" + leftPosition + ",top=" + topPosition + ",screenX=" + leftPosition + ",screenY=" + topPosition + ",toolbar=no,menubar=no,scrollbars=no,location=no,directories=no"; | |
u=location.href; | |
t=document.title; |
This file contains 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 numRand = String((new Date()).getTime()).replace(/\D/gi,'') |
This file contains 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
<!-- This link will take someone to your youtube channel then present them with a subscribe popup--> | |
<a href="http://www.youtube.com/subscription_center?add_user=artofblog">Text</a> |
This file contains 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
$(".downloadLink").click( | |
function(e) { | |
e.preventDefault(); | |
//open download link in new page | |
window.open( $(this).attr("href") ); | |
//redirect current page to success page | |
window.location="www.example.com/success.html"; | |
window.focus(); |
This file contains 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
git init - "Self explanatory" | |
git remote add origin [git_url] - "Adds a remote repository named origin" | |
git add . - "Add files you want to commit" | |
git add -u - "Will remove deleted files from git" | |
git commit -m 'your message' - "Commit with a message" | |
git push origin master - "Push repository to Github" | |
git update-index --assume-unchanged [[path]] - Will ignore file from git unless explicitly added | |
git reset --soft HEAD^ - Deletes last commit and keeps any code changes | |
git commit --amend --reuse-message HEAD |
This file contains 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
sudo rsync -arv -e "ssh" --rsync-path="sudo rsync" user@host:/home /backup |