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 fs = require('fs'); | |
var request = require('request'); | |
var urls = new Array("http://www.yahoo.com","http://www.bing.com"); | |
for (var i = 0; i < urls.length; i++) { | |
var file = 'log'+[i]+'.txt'; | |
var url = urls[i]; |
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 fs = require('fs'); | |
var request = require('request'); | |
var urls = new Array("http://www.yahoo.com","http://www.bing.com"); | |
function scrape(url,file){ | |
request(url, function (error, response, body) { | |
if (!error && response.statusCode == 200) { | |
console.log('request url: '+url); |
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
<style> | |
body {text-align: center;} | |
#drag { border: 10px solid black; text-align: center; padding:20px; width: 500px; margin: auto; font-size: 40px; display: inline-block;} | |
#einput {width:400px;} | |
#output {margin:20px;} | |
#filesinput, #directoryinput, #zipinput { | |
visibility: collapse; | |
width: 0px; | |
} | |
#output img{ |
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
{ | |
"glossary": { | |
"title": "example glossary", | |
"GlossDiv": { | |
"title": "S", | |
"GlossList": { | |
"GlossEntry": { | |
"ID": "SGML", | |
"SortAs": "SGML", | |
"GlossTerm": "Standard Generalized Markup Language", |
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 | |
/** | |
* @package A-Z Category Index | |
* @version 0.1 | |
*/ | |
/* | |
Plugin Name: A-Z Category Index | |
Plugin URI: http://wordpress.org/ | |
Description: A-Z Category Index where each letter takes you to a page with a list of categories that start with that letter. | |
Version: 0.1 |
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
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
//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
//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'}); |