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
//empty main section | |
$(".Grid").before('<div id="organized"/>').remove(); | |
//append sorted items | |
$.each(list, function(idx, itm) { | |
$("#organized").append($(itm).parents('.Pin')); | |
}); | |
//style it up | |
$('.Pin').css({'clear': 'both', 'position': 'static'}); |
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
//cleanup and sort elemets that have repins | |
//grab all pins | |
var mylist = $('.Pin'); | |
//find all pins that have repins | |
var listitems = mylist.find('.socialItem'); | |
var list = listitems.filter(function(f,i){ | |
var test = Number( $(i).text().trim().replace("repins", "").replace("repin", "") ); | |
if(test>0){ |
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
v1 = 1; // Global Scope | |
var v2 = 2; // Variable defined with var keyword but not within a function: Global Scope | |
function f() { | |
v3 = 3; // No var keyword: Global Scope | |
var v4 = 4; // Local Scope only | |
var v5 = v1+v2+v3; //1+2+3=6 - Local Scope only, can access v1 and v2 variables from the Global Scope | |
} | |
v1; //1 - JavaScript can access the variable as it lives in the Global Scope |
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
function one(y) { | |
var z = 1; | |
return function g(y) { | |
var all = y + z; | |
return all; | |
} | |
} | |
var z=10; | |
var b = one(); | |
function two(t){ |
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
function f(y) { | |
var z = 1; | |
return function g(y) { | |
alert(y + z); | |
} | |
} | |
var z=10; | |
f(); //returns the function: function g(y) {alert(y + z);} | |
f()(2); //grabs function g, assings 2 to y, knows z is 1 through closure scope and makes an alert(3) |
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
function f() { | |
var z = 1; | |
function g(y) { | |
alert(y + z); | |
} | |
g(2); | |
} | |
f();// calls f and alerts 3 | |
g(2); //ReferenceError: g is not defined |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Blank HTML5</title> | |
<style> | |
</style> | |
</head> | |
<body> |
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
www.three.com 10.15.101.11 1353280801 TEST 345 | |
www.one.com 10.14.101.11 1353280801 TEST 343 | |
www.three.com 1.10.11.71 1353280801 TEST 323 | |
www.one.com 10.15.11.61 1353280801 TEST 365 | |
www.two.com 10.10.11.51 1353290801 TEST 55 | |
www.two.com 10.20.13.11 1353290801 REST 435 | |
www.one.com 10.20.14.41 1353290801 REST 65 | |
www.two.com 10.10.11.14 1353290801 REST 345 | |
www.three.com 10.10.11.31 1354280801 REST 34 | |
www.one.com 10.10.13.144 1354280801 JSON 65 |
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
function getTypos($str) { | |
$typosArr = array(); | |
$strArr = str_split($str); | |
//Proximity of keys on keyboard | |
$arr_prox = array(); | |
$arr_prox['a'] = array('q', 'w', 'z', 'x'); | |
$arr_prox['b'] = array('v', 'f', 'g', 'h', 'n'); |
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
function getTypos(str) { | |
//http://stackoverflow.com/questions/1431094/how-do-i-replace-a-character-at-a-particular-index-in-javascript | |
String.prototype.replaceAt=function(index, char) { | |
return this.substr(0, index) + char + this.substr(index+char.length); | |
} | |
//define proximity arrays | |
var array_prox = []; |