Skip to content

Instantly share code, notes, and snippets.

View awatson1978's full-sized avatar
🏠
Working from home

Abigail Watson awatson1978

🏠
Working from home
View GitHub Profile
let remote = DDP.connect(Meteor.settings.public.remote.url);
Meteor.connection = remote;
Accounts.connection = remote;
Meteor.users = new Mongo.Collection('users', remote);
Orders = new Mongo.Collection('orders', remote);
FlowRouter.subscriptions = function () {
this.register('workstation', Meteor.settings.remote.id);
@awatson1978
awatson1978 / gist:9744515
Created March 24, 2014 17:03
db.mycollection.find({ _id: { $gt: objectIdWithTimestamp('1980/05/25') } });
// This function returns an ObjectId embedded with a given datetime
// Accepts both Date object and string input
function objectIdWithTimestamp(timestamp)
{
// Convert string date to Date object (otherwise assume timestamp is a date)
if (typeof(timestamp) == 'string') {
timestamp = new Date(timestamp);
}
@awatson1978
awatson1978 / gist:a46c9adc72c2762b9a03
Created October 11, 2014 05:26
Crazy Wacky Wandering Font
@-webkit-keyframes spin {
0% { .transform(rotate(0deg)); }
100% { .transform(rotate(359deg)); }
}
@keyframes spin {
0% { .transform(rotate(0deg)); }
100% { .transform(rotate(359deg)); }
}
https://projects.tessel.io/projects/enviroreport-web-dashboard-for-climate-module
https://github.com/chaivrep/EnviroReport
http://blog.mongodb.org/post/65517193370/schema-design-for-time-series-data-in-mongodb
@awatson1978
awatson1978 / gist:58181df67a66863f1cf0
Created April 3, 2015 16:56
Publishing a Command Line Tool in a Package
First you'll need an NPM package.
http://www.bennadel.com/blog/2329-building-executable-scripts-for-the-mac-osx-command-line-with-node-js.htm
Then you'll need to publish it.
https://gist.github.com/coolaj86/1318304
Then you'll need to add it to an atomsphere package.
https://github.com/awatson1978/meteor-cookbook/blob/master/cookbook/packages.md
````sh
# User for local dev
FROM app/base
RUN npm install -g orion-cli
# This forces package-catalog update. Should speed up further runs
RUN meteor show meteor-platform
@awatson1978
awatson1978 / gist:cce938ddfd5b961f86b6
Created May 21, 2015 20:42
Template.example.__helpers[" foo"]()

Note the __ underscores, the extra space before the method name, and the parantheses at the end.

Template.plantsListPage.__helpers[" hasNoContent"]()
http://swizec.com/blog/how-to-run-javascript-tests-in-chrome-on-travis/swizec/6647
@awatson1978
awatson1978 / gist:b81e3d7969d12b6bd136
Created July 12, 2015 20:15
Remove Package from Atmosphere
````
meteor admin set-unmigrated clinical:foo
````
@awatson1978
awatson1978 / gist:39cecf9ba5cd476ac85a
Last active August 29, 2015 14:27
Package.addComponet()
function addComponent(api, name, imports) {
  api.addFiles('components/' + name + '/' + name + '.html', 'client');
  api.addFiles('components/' + name + '/' + name + '.js', 'client');
  api.addFiles('components/' + name + '/' + name + '.styl', 'client');
  if(imports) {
    api.addFiles('components/' + name + '/skin.import.styl', 'client');
 api.addFiles('components/' + name + '/structure.import.styl', 'client');