Skip to content

Instantly share code, notes, and snippets.

@aaronthorp
aaronthorp / README.md
Last active August 29, 2015 13:56
Meteor.js Render and run JS once

Meteor.js - Render Run Once

Code implementation to execute code once on initial template render

Support us via Gittip

@aaronthorp
aaronthorp / README.md
Last active August 29, 2015 13:56
Meteor.js - Iron-Router Login Controller. @aaronthorp

Meteor.js - Iron-Router Login Controller

My code that utilises the accounts-entry package and manages authentication on routes

Support us via Gittip

@aaronthorp
aaronthorp / README.md
Last active August 29, 2015 13:56 — forked from dariocravero/README.md
Meteor.js - File Upload to Public. @aaronthorp

Meteor.js - File Upload to Public

Create a Meteor app and put the client_/server_ files in a client/server directories. Also, create a public dir to save the uploaded files.

Support us via Gittip

#/bin/sh
export MONGO_URL=mongodb://localhost/testing123
export MONGO_OPLOG_URL=mongodb://localhost/local
export ROOT_URL=http://dev.somewebsite.com
export DISABLE_WEBSOCKETS=true
mrt run --port 4005
@aaronthorp
aaronthorp / README.md
Last active September 13, 2017 16:09
Ubuntu Server - Meteor.JS Basic Configuration (node/meteor/brew) @aaronthorp

Ubuntu Server - Meteor.JS Basic Configuration

  • Includes Linux Homebrew, Node, Meteor and Meteorite.

To launch, copy and paste the code below into setup.sh, run chmod 777 setup.sh and then type ./setup.sh.

Alternatively...

Just paste curl https://gist.githubusercontent.com/aaronthorp/9384266/raw/setup.sh | /bin/sh in the terminal and watch the magic happen.

@aaronthorp
aaronthorp / paths.js
Created March 11, 2014 00:13
Meteor.JS Private and Public Folder Directories. @aaronthorp
// Root of Meteor.js App
meteor_root = Npm.require('fs').realpathSync( process.cwd() + '/../' );
// Private Assets Folder of Meteor.JS App
assets_root = meteor_root + "/server/assets/app/";
@aaronthorp
aaronthorp / sublime.reg
Created March 12, 2014 03:28
Sublime Text 2 - Windows Open Folder Registry Hack. @aaronthorp
Windows Registry Editor Version 5.00
; This will make it appear when you right click ON a folder
; The "Icon" line can be removed if you don't want the icon to appear
[HKEY_CLASSES_ROOT\Directory\shell\sublime]
@="Open Folder as &Sublime Project"
"Icon"="\"C:\\Program Files\\Sublime Text 2\\sublime_text.exe\",0"
[HKEY_CLASSES_ROOT\Directory\shell\sublime\command]
Template.request_reply.events = {
'click #response_sendButton': function() {
sendRequestResponse();
},
'keypress #response_response': function(e,t) {
if (e.charCode === 13)
sendRequestResponse();
}
};
@aaronthorp
aaronthorp / server.js
Created May 6, 2014 06:11
Meteor.JS Facebook ServerSide
function Facebook(accessToken) {
this.fb = Meteor.require('fbgraph');
this.accessToken = accessToken;
this.fb.setAccessToken(this.accessToken);
this.options = {
timeout: 3000,
pool: {maxSockets: Infinity},
headers: {connection: "keep-alive"}
}
this.fb.setOptions(this.options);
Router.onBeforeAction('loading');
Router.map(function() {
this.route('project', {
path: '/:_domain/projects/:_project',
data: function() {
return {'name': this.params._domain};
},
waitOn: function(){