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
head | |
script(src='http://code.jquery.com/jquery-1.6.2.min.js') | |
script(src='/socket.io/socket.io.js') | |
script(type='text/javascript') | |
var socket = io.connect('http://localhost:3000') | |
socket.on('downloadZipFileProgress', function (data) { | |
var progress = data.progress | |
if (progress < 100) | |
$('#downloadZipFileProgress').text(progress.toFixed(2) + '%') |
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 sys = require('sys'), | |
http = require('http'), | |
url = require('url'), | |
fs = require('fs'), | |
path = require('path'), | |
io = require('socket.io').listen(app), | |
uuid = require('node-uuid'), | |
redisUtil = require('../common/redisutil'); |
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
Business.loadFromCSV = function(csvFilePath) { | |
csv().fromPath(csvFilePath, { columns: true, trim: true }) | |
.on('data', loadBusiness) | |
.on('end', handleSuccess) | |
.on('error', handleLoadError); | |
}; | |
function loadBusiness(data, index) { | |
var business = data; | |
util.removeNullOrEmptyPropertiesIn(business); |
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 isNullOrEmpty(value) { | |
return !value || value.length === 0 || /^\s*$/.test(value); | |
} | |
function removeNullOrEmptyPropertiesIn(object) { | |
for (var propertyName in object) | |
{ | |
var propertyValue = object[propertyName]; | |
if (isNullOrEmpty(propertyValue)) |
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
// Initialization | |
var csv = require('csv'); | |
var neo4j = require('neo4j'); | |
var db = new neo4j.GraphDatabase(process.env.NEO4J_URL || 'http://localhost:7474'); | |
// Constants: | |
var INDEX_NAME = 'nodes'; | |
var INDEX_KEY = 'type'; |
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
public partial class TweetStreamer : Form | |
{ | |
private List<Tweet> tweets; | |
private readonly IObservable<EventPattern<EventArgs>> stopClicked; | |
private readonly DataContractJsonSerializer jsonSerializer; | |
public TweetStreamer() | |
{ | |
InitializeComponent(); | |
jsonSerializer = new DataContractJsonSerializer(typeof (TweetSearchResult)); |
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
powershell .\InstanceSpinner.ps1 -operation start -secretKeyId "[your secret key]" -secretAccessKeyId "[your access key]" -instanceIds "[first instance ID]","[second instance ID]" | |
powershell .\InstanceSpinner.ps1 -operation stop -secretKeyId "[your secret key]" -secretAccessKeyId "[your access key]" -instanceIds "[first instance ID]","[second instance ID]" |
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
param([string]$operation, [string]$secretKeyId, [string]$secretAccessKeyId, [string[]]$instanceIds) | |
Add-Type -Path ".\AWSSDK.dll" | |
function StartInstances() | |
{ | |
$ec2Client = CreateEC2Client | |
$request = New-Object -TypeName Amazon.EC2.Model.StartInstancesRequest | |
$request.InstanceId = GetInstancesFromParameterList |