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
| insert into [dbo].[Customer] (FirstName, LastName, DateCreated) | |
| select | |
| f_name, | |
| l_name, | |
| getdate() | |
| from [dbo].[Cust] | |
| -- No Where Statement, Careful! |
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
| // csvHelper.js | |
| var events = require('events'); | |
| function CsvHelper () { | |
| this.config = null; | |
| this.data = null; | |
| // Need to instantiate EventEmitter constructor | |
| events.EventEmitter.call(this); | |
| } |
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
| db.copyDatabase("db_to_rename","db_renamed","localhost") | |
| use db_to_rename | |
| db.dropDatabase(); |
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(exports){ | |
| // Only allow files uploaded below a maximum size | |
| exports.isValidSize = function(sourceSize){ | |
| var maxSize = 1024 * 1024 * 10; // 10MB | |
| return sourceSize <= maxSize; | |
| }; | |
| })(typeof exports === 'undefined'? this['lib.image']={}: exports); |
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'); | |
| var app = express(); | |
| // Put static files in a public folder in the same directory as app.js | |
| app.use(express.static(__dirname + '/public')); | |
| app.set('port', 3000); | |
| app.listen(app.get('port'), function () { | |
| }); |
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'); | |
| var app = express(); | |
| app.use(function (req, res, next) { | |
| res.setHeader('Access-Control-Allow-Origin', req.headers.origin); | |
| }); |
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
| skydrive /start |
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
| skydrive /shutdown |
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 cached = {}; | |
| var allTags = ["red", "pants", "jeans", "red", "black", "jeans", "black", "pants", "jeans"]; | |
| var duplicatedTags = []; | |
| for (var i=0;i<allTags.length; i++) { | |
| if (cached[allTags[i]] == undefined) { | |
| cached[allTags[i]] = allTags[i]; | |
| if (hasDup(allTags, allTags[i], allTags.length)) { |
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
| // Some sample data | |
| var image1 = { name: 'google1', ext: 'jpg', url: '/some/url.jpg', tags: ['red', 'pants', 'jeans'] }; | |
| var image2 = { name: 'apple5', ext: 'png', url: '/some/url.png', tags: ['red', 'black', 'jeans'] }; | |
| var image3 = { name: 'nexus7', ext: 'png', url: '/some/url.png', tags: ['black', 'pants', 'jeans', 'jeans'] }; | |
| // Tags for an image can have NO duplicate tags | |
| image1.tags = _.uniq(image1.tags); image2.tags = _.uniq(image2.tags); image3.tags = _.uniq(image3.tags); | |
| var images = []; | |
| images.push(image1); images.push(image2); images.push(image3); |
NewerOlder