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
//CHECK DUPLICATE IPs | |
$ip = $_SERVER["REMOTE_ADDR"]; | |
$maxDuplicates = 200; | |
$sql = "SELECT COUNT(*) FROM --currentTable-- WHERE ip = '$ip'"; | |
$res = $db->query($sql); | |
$duplicateIP = $res->fetchColumn(); | |
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
n = name | |
s = symbol | |
l1 = last trade | |
c1 = change | |
g = day low | |
h = day high | |
j = 52 week low | |
k = 52 week high | |
p2 = %change | |
a2 = average daily volume |
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
//REASSIGN VARIABLES | |
storyTitle = "New title, can also be a variable with no quotes."; | |
storyURL = "http://res.dallasnews.com/graphics/2015_03/index.html"; //Can also be a variable | |
storyImG = "http://res.dallasnews.com/graphics/2015_03/customPreview.jpg"; //Can also be a variable | |
leadText = "A custom description based on whatever you can script", //Can also be a variable | |
//ATTACH THEM TO THE APPROPRIATE PROPERTIES | |
$("meta[property='og\\:title']").attr("content", storyTitle); | |
$("meta[property='og\\:url']").attr("content", storyURL); | |
$("meta[property='og\\:image']").attr("content", storyImg); |
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
//url formate should be ...index.html/?targetDiv | |
$(document).ready(function () { | |
//CHECK FOR VARIABLES IN URL | |
var rawKeys = $(location).attr('search'); | |
if (rawKeys) { | |
console.log(rawKeys); //displays "?targetDiv" | |
var strippedKey = rawKeys.substring(1); //get rid of question mark | |
console.log(strippedKey); //displays "targetDiv" |
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 is_touch_device() { | |
return 'ontouchstart' in window || 'onmsgesturechange' in window; | |
}; | |
var isMobile = is_touch_device(); | |
if (isMobile){ | |
}else{ |
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
$sql = "SELECT COUNT(*) FROM " . $thisTable . " WHERE ip = '$ip'"; | |
echo $sql; | |
$res = $db->query($sql); | |
if (! $res) { | |
print_r($db->errorInfo()); | |
} | |
$duplicateIP = $res->fetchColumn(); |
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
///Branching an existing branch | |
git pull origin <original branch name> | |
git checkout <original branch name> | |
git checkout -b <new branch name> | |
# Edit some files | |
git add . | |
git commit -m “Added some stuff” | |
git push origin <new branch name> |
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
git checkout <branch name> | |
git add . | |
git commit -m "enter a commit message" | |
git checkout master | |
git merge <branch name> | |
git add . | |
git commit -m "merged" | |
git push origin master |
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
//Create a new repository | |
git init | |
//Start copy from github | |
git clone https://github.com/LayneSmith/shotput.git | |
//Fetch and merge changes on remote server to your working directory | |
git pull | |
//List all remote and local branches |
OlderNewer