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 find( mode, string, begin, end ) { | |
| console.log("the input " + string); | |
| var startIndex = string.indexOf(begin); | |
| var endIndex = string.indexOf(end, startIndex + 1); | |
| if( startIndex === -1 && endIndex === -1 ) return ""; | |
| var result = ( mode === "include" ) ? | |
| string.slice( startIndex + begin.length, endIndex ) : | |
| string.slice( 0, startIndex ) + string.slice( endIndex + end.length ); | |
| console.log("the return " + result); | |
| return result; |
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 net = require("net"); | |
| var server = net.createServer(telnetServer).listen(6000); | |
| function telnetServer(socket) { | |
| socket.write("Welcome. Enter URL For Scraping\n"); | |
| socket.on('close', function() { | |
| socket.write("GoodBye\n"); | |
| }); |
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 net = require('net'); | |
| var socket = net.Socket(); | |
| socket.on('error', function(error) { | |
| console.log(error); | |
| }); | |
| process.argv.forEach(function (value, index, array) { | |
| if ( value !== "node" && | |
| value !== __filename ) processValue(value); |
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 net = require('net'); | |
| var events = require('events'); | |
| var channel = new events.EventEmitter(); | |
| channel.clients = {}; | |
| channel.subscriptions = {}; | |
| channel.on('join', function(id, client) { | |
| this.clients[id] = client; | |
| this.subscriptions[id] = function(senderId, message) { |
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 http = require('http'); | |
| function response(res, cb) { | |
| var buffer = ''; | |
| res.on('data', function(chunk) { | |
| buffer += chunk.toString(); | |
| }); | |
| res.on('end', function(){ | |
| console.log(buffer); | |
| }); |
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($) { | |
| function shuffle(selector) { | |
| var children = $(selector).children().get().sort(function() { | |
| return Math.random() - 0.5; | |
| }); | |
| $(selector).append(children); | |
| } | |
| function success(options) { | |
| $("h1").text(options.successMsg); |
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
| require 'formula' | |
| class NginxCustom < Formula | |
| homepage 'http://nginx.org/' | |
| url 'http://nginx.org/download/nginx-1.4.3.tar.gz' | |
| sha1 '8d0c34c84ce6dd8ba4442889e8f2599044c90930' | |
| devel do | |
| url 'http://nginx.org/download/nginx-1.5.6.tar.gz' | |
| sha1 '24d84eccc7fecd98d19330ef708d3ea29031abc7' |
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
| require 'formula' | |
| class Nginx < Formula | |
| homepage 'http://nginx.org/' | |
| url 'http://nginx.org/download/nginx-1.4.3.tar.gz' | |
| sha1 '8d0c34c84ce6dd8ba4442889e8f2599044c90930' | |
| devel do | |
| url 'http://nginx.org/download/nginx-1.5.6.tar.gz' | |
| sha1 '24d84eccc7fecd98d19330ef708d3ea29031abc7' |
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
| <div ng-controller="TestCtrl"> | |
| <nvd3-line-chart | |
| x="chart.xVal()" | |
| y="chart.yVal()" | |
| xAxisTickFormat="chart.xAxis()" | |
| data="data" | |
| width="640" | |
| height="400" | |
| showXAxis="true" | |
| showYAxis="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
| nv.addGraph( function() { | |
| var data = [ | |
| {"key" : "Amount", "values" : [ | |
| ["1406188303", 383], | |
| ["1407121032", 1176], | |
| ["1407121182", 799], | |
| ["1408066502", 0] | |
| ]}, | |
| {"key" : "Count", "values" : [ | |
| ["2014-07-24", 1], |