Skip to content

Instantly share code, notes, and snippets.

@nanusdad
nanusdad / svn-in-place-import
Created July 23, 2013 21:48
SVN : In-place import commands
# 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 December 20, 2015 03:49
Meteor : authenticate call back example
// 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 July 26, 2013 00:40
Node JS : continous 'live' stdout example
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 August 2, 2013 14:39
Meteor JS - Running mongod manually
e.g
/usr/lib/meteor/mongodb/bin/mongod --dbpath /mnt/apshared/webmeteor/myapp/.meteor/local/db/
@nanusdad
nanusdad / bootstrap-flush-footer-bottom
Created August 4, 2013 08:35
Bootstrap - flushing footer to bottom of page ( from http://bootstrapfooter.codeplex.com/ )
@nanusdad
nanusdad / handlebars-each-index-key
Created August 6, 2013 05:01
Handlebars - each with @key and @Index
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 August 8, 2013 20:28
Sublime Text 3 - installing Package Control
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
@nanusdad
nanusdad / meteor-publish-with-sort.js
Created August 8, 2013 22:39
Meteor publish with sort
Meteor.publish('todos', function() {
return Todos.find({}, {
sort: {
timestamp: -1
}
});
});
@nanusdad
nanusdad / meteor-email-send.js
Created August 9, 2013 02:57
Meteor - email send example
/**
* 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 August 13, 2013 20:42
Handling difference between Chrome and Firefox for window.event and 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 {