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
| var links = []; | |
| var quotes = []; | |
| var tempUrl = []; | |
| var infos = []; | |
| var maxLinks = 10; | |
| var firstUrl = 'http://www.imdb.com/search/title?at=0&num_votes=5000,&sort=user_rating,desc&start=1&title_type=tv_infoss'; | |
| var newUrl; | |
| var x = require('casper').selectXPath; |
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
| /* | |
| Infinite List View | |
| creates <ul> with triggers for infinite scrolling | |
| @author Kevin Jantzer, Blacktone Audio Inc. | |
| @since 2012-11-06 | |
| USE - listen for: |
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
| var express = require('express') | |
| , mongoskin = require('mongoskin') | |
| var app = express() | |
| app.use(express.bodyParser()) | |
| var db = mongoskin.db('localhost:27017/test', {safe:true}); | |
| app.param('collectionName', function(req, res, next, collectionName){ | |
| req.collection = db.collection(collectionName) |
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
| // @source: http://stackoverflow.com/questions/1349404/generate-a-string-of-5-random-characters-in-javascript | |
| function randomStr(m) { | |
| var m = m || 9; s = '', r = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; | |
| for (var i=0; i < m; i++) { s += r.charAt(Math.floor(Math.random()*r.length)); } | |
| return s; | |
| }; |
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
| <!doctype html> | |
| <html> | |
| <head> | |
| <!-- Run in full-screen mode. --> | |
| <meta name="apple-mobile-web-app-capable" content="yes"> | |
| <!-- Make the status bar black with white text. --> | |
| <meta name="apple-mobile-web-app-status-bar-style" content="black"> |
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
| <script type="text/javascript"> | |
| $(document).ready(function() { | |
| var href = $("#redirect_url")[0].href; | |
| $("a#replace_me").attr("href", href); | |
| $("a#replace_me").text(href); | |
| $("#redirect_to").hide(); | |
| }); | |
| </script> | |
| <p>Greetings. We are now redirecting you to the site that you requested.</p> |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Document</title> | |
| </head> | |
| <body> | |
| Input: <input type="text" ng-model="hello"><br> |
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
| // http://localhost:4000/api/postcodesNear?postcode=4101&range=2 | |
| action('postcodesNear', function () { | |
| var earthRadius = 6378; | |
| var qPostcode = req.query.postcode || 4101; | |
| var qRange = Number(req.query.range) || 2; | |
| Postcode .findOne({ 'postcode': qPostcode }) | |
| .run(function(err, postcode) { | |
| if (err) send(err); |
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
| <!doctype html> | |
| <html ng-app="myApp"> | |
| <head> | |
| <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.min.js"></script> | |
| <script type="text/javascript"> | |
| var myApp = angular.module('myApp', [], function ($interpolateProvider) { | |
| $interpolateProvider.startSymbol('[['); | |
| $interpolateProvider.endSymbol(']]'); | |
| }); |
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 getParameterByName(name) { | |
| var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search); | |
| return match && decodeURIComponent(match[1].replace(/\+/g, ' ')); | |
| } | |
| // Useful for a url like www.iframe.com/93493434?pram_name=2323 |