No sync versions of functions. These may encapsulate high-latency remote filesystems. Including sync operations is inappropriate.
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
17:17 judofyr: hey folks | |
17:17 judofyr: what's up? | |
17:17 Aria: Not too much. | |
17:17 Aria: Grumbling about managing ruby dependencies with RPM. | |
17:17 judofyr: RPM? | |
17:18 Aria: It's become so damn hard. So much versioning hell out there. | |
17:18 judofyr: why would you do that? | |
17:18 judofyr: bundler it up | |
17:18 Aria: I'm the OS integrator. We're trying to package apps out there for installation. | |
17:19 judofyr: hm |
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 RowView = Backbone.View.extend({ | |
initialize: function () { | |
this.model.on('change', this.handleChange, this); | |
}, | |
handleChange: function () { | |
this.model.save(); | |
}, | |
render: function () { | |
this.setElement($('<tr>')); | |
this.$el.append("<td>" + this.model.get('id') + "</td><td>" + this.model.get('field1') + "</td>"); |
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
/usr/img/lib/imgadm.js:1124 | |
for (var j = 0; j < imageSet.length; j++) { | |
^ | |
TypeError: Cannot read property 'length' of undefined | |
at done (/usr/img/lib/imgadm.js:1124:45) | |
at async.forEach (/usr/img/node_modules/async/lib/async.js:88:21) | |
at IMGADM.sourcesList.async.forEach.err (/usr/img/lib/imgadm.js:1102:21) | |
at IMGADM.clientFromSource (/usr/img/lib/imgadm.js:744:13) | |
at Source.getResolvedUrl (/usr/img/lib/imgadm.js:361:13) | |
at /usr/img/lib/imgadm.js:98:13 |
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
module ApplicationHelper | |
def combine_highlight(selected_text, surrounding_text) | |
if surrounding_text.include? selected_text | |
split_text_array = surrounding_text.split(selected_text) | |
if split_text_array[0].blank? | |
if split_text_array[1].blank? | |
content_tag(:p, content_tag(:span, selected_text, class:"selected")) | |
else |
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
module ApplicationHelper | |
def combine_highlight(selected_text, surrounding_text) | |
if surrounding_text.include? selected_text | |
split_text = surrounding_text.split(selected_text) | |
content_tag(:p, (split_text[0] || '').html_safe + content_tag(:span, selected_text, class:"selected") + (split_text[1] || '').html_safe) | |
else | |
content_tag(:p, surrounding_text, class:"selected") | |
end | |
end |
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
Friend.findOne({ | |
userId: req.signedCookies.userid | |
}, function (err, signedInUser) { | |
function doCheck(err, currentUser) { | |
if (err) { | |
res.send(err); | |
} else { | |
console.log('doCheck'); | |
//for(var x = 0; x < users.length; x++) { | |
//var currentUser = users[x]; |
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
<script src="http://localhost:3000/socket.io/socket.io.js"></script> | |
<script> | |
var news = io.connect('http://localhost:3000/').of('/news'); | |
news.emit("raul", new Array("1","2","3","4","5","6","7","8","9","10") ); | |
news.on('get_random_number_from_raul', function(data) { | |
console.log('random', data); | |
}); |
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
module.exports = function Class() {} | |
Class.prototype.method = function () { | |
SomethingInternal.call(this) | |
} | |
function SomethingInternal() { | |
console.log("I'm internal, and I'm currently a method of", this); | |
} |
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 fs = require('fs'); | |
function writeTime(){ | |
var lifedata; | |
var filename = './life.json'; | |
fs.readFile(filename, 'utf8', function (err, data) { | |
if (err) throw err; | |
lifedata = JSON.parse(data); | |
doWrite(); | |
}); |