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
| #!/usr/bin/ruby | |
| require 'rubygems' | |
| require 'mongrel' | |
| server = Mongrel::HttpServer.new("0.0.0.0", "3000") | |
| server.register("/", Mongrel::DirHandler.new(".")) | |
| server.run.join |
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
| ~/.node_libraries/redis-client.js |
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
| client = require('redis-client'); |
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
| $image_w = imagesx($image); | |
| $image_h = imagesy($image); | |
| //figure out if we are going to resize by the width or the height | |
| //if the original image is wider than the new dimension, resize by the width | |
| // or else resize by the height | |
| if (($image_w / $image_h) >= ($new_w / $new_h)) { | |
| $h = $image_h * $new_w / $image_w; | |
| $w = $new_w; | |
| } 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
| //if the image if taller than wide, resize W to desired length then crop the top and bottom to fit | |
| if($image_w < $image_h) { | |
| $tmp_h=$image_h*($new_h/$image_w); | |
| $tmp_big = imagecreatetruecolor($new_w, $tmp_h); | |
| $tmp = imagecreatetruecolor($new_w, $new_h); | |
| $diff = ($tmp_h - $new_h)/2; | |
| imagecopyresampled($tmp_big,$image,0,0,0,$diff,$new_w,$tmp_h,$image_w,$image_h); | |
| imagecopyresampled($tmp,$tmp_big,0,0,0,$diff,$new_w,$new_h,$new_w,$new_h); | |
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
| //get canvas element | |
| var canvas = document.getElementById("main"); | |
| //get context | |
| var ctx = canvas.getContext('2d'); | |
| //create new image object | |
| var image = new Image(); | |
| //set callback for when the image actually loads |
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 nickname = ""; | |
| var socket; | |
| //send the chat server your nickname and close the dialog box | |
| function joinChat() | |
| { | |
| socket.emit('join', nickname); | |
| $("#nick-modal").dialog('close') | |
| } |
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
| '' == '0' // false | |
| 0 == '' // true | |
| 0 == '0' // ture | |
| false == 'false' // false | |
| false == '0' // true | |
| false == undefined // false | |
| false == null // false | |
| null == undefined // true |
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
| #!/bin/bash | |
| nohup perl runner.pl -Delete=1 -LinkID=330410154 -AssumedDate=2011-08-02 -DoCache=1 & |
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
| /* REMOVE */ | |
| use lib "/usr/local/navivision/spidering/common"; | |
| use NVParser; | |
| /* ADD */ | |
| BEGIN { | |
| unshift (@INC, "$ENV{'CRAWLER_PATH'}/common"); | |
| } |
OlderNewer