Skip to content

Instantly share code, notes, and snippets.

View escaroda's full-sized avatar

Escaroda escaroda

View GitHub Profile
# Note: if you want to run multiple meteor apps on the same server,
# make sure to define a separate port for each.
# Upstreams
upstream gentlenode {
server 127.0.0.1:58080;
}
# HTTP Server
server {

How to get facebook login working with Meteor and Cordova on iOS

Step 1: Make your local dev site internet accessible

Because there is an issue with OAuth2 login and localhost development, you currently have to deploy your meteor site to be able to test the Facebook login. A nice little workaround for this is to make the local instance of meteor accessible externally.

There is a great online guide for setting up port forwarding with your router and you can check your public external IP here.

For example, If you have an Apple router, simply open up Airport Utility on your Mac and click edit on your router, then go to the Network tab. Under Port Settings click the + icon and select Personal Web Sharing, setting all of the public and private ports to 3000. Make sure the private IP is set to your current computer IP.

@escaroda
escaroda / myview.js
Last active August 29, 2015 14:23 — forked from npaton/myview.js
// <canvas id="resizeCanvas" width="10000" height="10000" style="display:none"></canvas>
Template.myview.events({
"change .image-select": function(e, t) {
// Verify it's an image...
console.time("total");
var img = document.createElement("img");
img.src = window.URL.createObjectURL(e.currentTarget.files[0]);
img.onload = function () {
@escaroda
escaroda / slugify.js
Last active August 29, 2015 14:22 — forked from mathewbyrne/slugify.js
function slugify(text)
{
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}