Skip to content

Instantly share code, notes, and snippets.

var Crawler = require("crawler").Crawler;
var c = new Crawler({
// here you can define, how many pages you want to do in parallel
"maxConnections":10,
// This will be called for each crawled page
"callback":function(error,result,$) {
// mark this page as available or not based on the reponse
console.log(result.statusCode);
@mlaug
mlaug / forminfo.html
Created April 7, 2012 21:42
Form info field
<!DOCTYPE html>
<html>
<head>
<title>Form Info</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(':input.form-input').live('focus', function(){ //get input field
$(this)
@mlaug
mlaug / fizzbuzz.php
Created April 7, 2012 21:26
PHP FizzBuzz
<?php
for($i=1;$i<=100;$i++){
$div3 = $i%3 == 0;
$div5 = $i%5 == 0;
if ( $div3 && $div5 ){
echo "FizzBuzz";
}
elseif ( $div3 ){
@mlaug
mlaug / index.html
Created April 7, 2012 19:19
Async Image Loader
<!DOCTYPE html>
<html>
<head>
<title>Image Loader</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="http://remysharp.com/downloads/jquery.inview.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('.canvas-image-loader').bind('inview',function(event, visible){
var _this = this;