Skip to content

Instantly share code, notes, and snippets.

@nanusdad
nanusdad / svn-in-place-import
Created Jul 23, 2013
SVN : In-place import commands
View svn-in-place-import
# svn mkdir file:///root/svn-repository/etc \
-m "Make a directory in the repository to correspond to /etc"
# cd /etc
# svn checkout file:///root/svn-repository/etc ./
# svn add apache samba alsa X11
# svn commit -m "Initial version of my config files"
@nanusdad
nanusdad / meteor-authenticate-call
Last active Dec 20, 2015
Meteor : authenticate call back example
View meteor-authenticate-call
// This goes in the client sub directory or use Meteor.isClient check
// http://docs.meteor.com/#meteor_isclient
Meteor.call('authenticate', user, pswd, function(err, res) {
if(err) {
console.log('error trying login');
}
else {
console.log(res);
Session.set('logged_in_user', user);
@nanusdad
nanusdad / spawn-continous-stdout
Created Jul 26, 2013
Node JS : continous 'live' stdout example
View spawn-continous-stdout
var util = require('util'),
spawn = require('child_process').spawn,
ls = spawn('ls', ['-lh', '/usr']);
ls.stdout.on('data', function (data) {
console.log('stdout: ' + data);
});
ls.stderr.on('data', function (data) {
console.log('stderr: ' + data);
@nanusdad
nanusdad / meteor-mongod-cmd
Created Aug 2, 2013
Meteor JS - Running mongod manually
View meteor-mongod-cmd
e.g
/usr/lib/meteor/mongodb/bin/mongod --dbpath /mnt/apshared/webmeteor/myapp/.meteor/local/db/
@nanusdad
nanusdad / bootstrap-flush-footer-bottom
Created Aug 4, 2013
Bootstrap - flushing footer to bottom of page ( from http://bootstrapfooter.codeplex.com/ )
View bootstrap-flush-footer-bottom
View handlebars-each-index-key
When looping through items in each, you can optionally reference the current loop index via {{@index}}
{{#each array}}
{{@index}}: {{this}}
{{/each}}
For object iteration, use {{@key}} instead:
{{#each object}}
{{@key}}: {{this}}
@nanusdad
nanusdad / sublime-text3-pkg-ctrl
Created Aug 8, 2013
Sublime Text 3 - installing Package Control
View sublime-text3-pkg-ctrl
1. Open up the Windows "Search" Bar and start typing in "git bash" and click on the program that comes up.
2. Type in the following
CODE: SELECT ALL
cd $APPDATA/Sublime\ Text\ 3/Packages
3. Now type in
View meteor-publish-with-sort.js
Meteor.publish('todos', function() {
return Todos.find({}, {
sort: {
timestamp: -1
}
});
});
@nanusdad
nanusdad / meteor-email-send.js
Created Aug 9, 2013
Meteor - email send example
View meteor-email-send.js
/**
* Meteor - Email send example
* MAIL_URL environment variable required
* e.g smtp://localhost:25
*/
Email.send({
from: config.email.from,
to: mailto,
subject: config.email.subj + todo.name,
html: "<b>" + todo.status + "</b>"
@nanusdad
nanusdad / get-srcElement
Created Aug 13, 2013
Handling difference between Chrome and Firefox for window.event and srcElement
View get-srcElement
'click .cancelbtn': function(e) {
// To handle difference between Chrome and FF
e = e || window.event;
var se_id = e.target || e.srcElement;
if (se_id) {
console.log('Worked' + se_id);
var c_id = se_id.id;
} else {