This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// meteor add iron:router | |
// https://github.com/EventedMind/iron-router/blob/devel/Guide.md#route-options | |
Router.route('/post/:_id', { | |
// The name of the route. | |
// Used to reference the route in path helpers and to find a default template | |
// for the route if none is provided in the "template" option. If no name is | |
// provided, the router guesses a name based on the path '/post/:_id' | |
name: 'post.show', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.serializeObject = function() | |
{ | |
var o = {}; | |
var a = this.serializeArray(); | |
$.each(a, function() { | |
if (o[this.name]) { | |
if (!o[this.name].push) { | |
o[this.name] = [o[this.name]]; | |
} | |
o[this.name].push(this.value || ''); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"useIndex": true, | |
"indexFilePath":"client/stylesheets/main.scss", | |
"enableAutoPrefixer": true | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ES6 | |
class Tweet { | |
constructor (doc) { | |
_.extend(this, doc); | |
} | |
} | |
Tweets = new Mongo.Collection('tweets', { | |
transform (doc) { | |
return new Tweet(doc); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Meteor.methods({ | |
// Get the connections *real* IP | |
getConnectionIP: function () { | |
// No need to make others wait | |
this.unblock(); | |
// Locals | |
var conn = this.connection; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin wihe ($width:initial , $height:initial) { | |
width: $width; | |
height: $height; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin aspect-ratio($width, $height) { | |
position: relative; | |
&:before { | |
display: block; | |
content: ""; | |
width: 100%; | |
padding-top: ($height / $width) * 100%; | |
} | |
> .content { | |
position: absolute; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template name="ForgotPassword"> | |
<form action="/forgot" id="forgotPasswordForm" method="post"> | |
<input id="forgotPasswordEmail" type="text" name="email" placeholder="Email Address"> | |
<input class="btn-submit" type="submit" value="Send"> | |
</form> | |
<!-- end #forgot-password-form --> | |
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.clickable{ | |
position: relative; | |
&:after{ | |
position:absolute; | |
content:''; | |
top:-10px; | |
right:-10px; | |
left:-10px; | |
bottom:-10px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Another example where you want to initialize a plugin when the subscription is done: | |
Template.listing.onRendered(function () { | |
var template = this; | |
template.subscribe('listOfThings', function () { | |
// Wait for the data to load using the callback | |
Tracker.afterFlush(function () { | |
// Use Tracker.afterFlush to wait for the UI to re-render | |
// then use highlight.js to highlight a code snippet |
OlderNewer