Skip to content

Instantly share code, notes, and snippets.

View SiddharthaChowdhury's full-sized avatar
🌄
Journey

Austin4Silvers SiddharthaChowdhury

🌄
Journey
View GitHub Profile
module.exports = {
onlyNumber: function(sample){
// returns false if input is not a number
return /^([0-9]+)$/.test(sample);
},
onlyAlphabets: function(sample){
// returns false if input is not a string of alphabets
return /^([a-z]+)$/.test(sample);
},
@mikermcneil
mikermcneil / using-raw-socket-io-in-sails.js
Created September 17, 2013 18:32
Using raw socket.io functionality in a Sails.js controller
module.exports = {
/**
*
* Using raw socket.io functionality from a Sails.js controller
*
*/
index: function (req,res) {