Skip to content

Instantly share code, notes, and snippets.

@aaronthorp
aaronthorp / publish.js
Last active September 20, 2019 10:57
Meteor observe subscription example
Meteor.publish('usersImages',function(groupName){
var collectionName = "user_images";
var subscription = this;
group = Groups.findOne({name:groupName});
if(!group) {
subscription.stop();
} else {
@aaronthorp
aaronthorp / jsoncsv.py
Created October 2, 2014 12:59
JSON to CSV with Python
import csv
import json
f = open('partscon.json', 'r')
x = json.loads(f.read().decode('utf-8-sig'))
f.close()
#x = json.loads(x)
f = csv.writer(open("partscon-final.csv", "wb+"))
@aaronthorp
aaronthorp / cfs.js
Created October 29, 2014 00:26
Modulus.io CollectionFS Filesystem Tempstore fix
// Declare custom tempstore path for Modulus.io
//
// can also use: process.env.TEMP_DIR instead of "/mnt/data/tmp"
//
if (Meteor.isServer) {
FS.TempStore.Storage = new FS.Store.FileSystem("_tempstore", {
internal : true,
path : '/mnt/data/tmp',
});
@aaronthorp
aaronthorp / cfs.js
Last active August 29, 2015 14:08
CFS FileSystem
FS.TempStore.Storage = new FS.Store.FileSystem("_tempstore", {
internal : true,
path : '/mnt/data/tmp',
});
SpreadsheetFS = new FS.Collection("spreadsheets", {
stores: [new FS.Store.FileSystem("spreadsheets", {path: "/app-storage/uploads"})],
filter: {
allow: {
contentTypes: [
@aaronthorp
aaronthorp / 0_reuse_code.js
Last active August 29, 2015 14:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
ThingyCollection = new Meteor.Collection("thingy", {
transform: function (doc) {
if (doc.thingy)
doc.thingy = doc.thingy.toUpperCase();
return doc;
}
});
Template.foo.events(
'submit form': (e)->
e.preventDefault()
)
on *:text:*:#:{
var %m = $lower($1-)
var %n = $lower($me)
if (%n isin %m) noop $tip(me_tip,$nick mentioned you in #,$1-)
}
server {
listen 80;
server_name dev.websitename.com.au;
location / {
proxy_pass http://localhost:4001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
Meteor Up: Production Quality Meteor Deployments
------------------------------------------------
Building Started: /path/to/the/app
Bundling Error: code=-1, error:spawn ENOENT
-------------------STDOUT-------------------
-------------------STDERR-------------------