Skip to content

Instantly share code, notes, and snippets.

View guidouil's full-sized avatar
🍌
Floating

Guillaume Darbonne guidouil

🍌
Floating
View GitHub Profile
@Fedia
Fedia / event_extension.js
Created November 16, 2012 17:47
Extending Deployd Event's domain
(function(Script) {
var _run = Script.prototype.run;
Script.prototype.run = function(ctx, domain, fn) {
if (typeof domain === 'object') {
domain.require = function(module) {
return require(module);
};
domain.context = function() { // access Context via context()
return ctx;
};
@thoop
thoop / nginx.conf
Last active December 8, 2023 21:55
Official prerender.io nginx.conf for nginx
# Change YOUR_TOKEN to your prerender token
# Change example.com (server_name) to your website url
# Change /path/to/your/root to the correct value
server {
listen 80;
server_name example.com;
root /path/to/your/root;
index index.html;
@jhgaylor
jhgaylor / meteor_download.js
Last active January 18, 2018 10:31
Download files to the filesystem on the meteor server
//given the urls of files to download, store them on the filesystem
function download_all_files (urls, base_destination, job_id, cb) {
var url = urls.shift();
var file_path = path.join(base_destination, job_id);
// the path to the file without the filename
var path_to_file_folder = path.dirname(file_path);
// the method to store a downloaded file to the fs
// makes an http request and writes the response to a file
# METEOR CORE:
Anywhere: Meteor.isClient
Anywhere: Meteor.isServer
Anywhere: Meteor.startup(func)
Anywhere: Meteor.absoluteUrl([path], [options])
Anywhere: Meteor.settings
Anywhere: Meteor.release
@jperl
jperl / Sizes.md
Created October 30, 2014 17:40
Meteor App Icon and Launch Screen Size Guide

###Icons

Name Size
iphone_2x 120x120
iphone_3x 180x180
ipad 76x76
ipad_2x 152x152
android_ldpi 36x36
android_mdpi 48x48
@bellbind
bellbind / app.html
Created May 20, 2015 07:23
[electron]Use electron as a Web Server
<!doctype html>
<html><head><script src="app.js"></script></head><body></body></html>
@jamielob
jamielob / Meteor IOS facebook login guide.markdown
Last active April 8, 2017 19:54
Meteor cordova ios facebook login

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.

@jhgaylor
jhgaylor / foo.js
Created September 15, 2015 23:06
<!-- this is a comment
console.log("omg that worked!")
@gsabran
gsabran / meteorFacebookMobileLogin.js
Last active November 17, 2017 04:04
A route that takes an access token from Facebook as an input and behave consistently with Meteor accounts
import { Accounts } from 'meteor/accounts-base';
import { ServiceConfiguration } from 'meteor/service-configuration';
// currently you need to use a local version of the facebook package with this change:
// https://github.com/meteor/meteor/pull/7550
import { Facebook } from 'meteor/facebook';
import { HTTP } from 'meteor/http';
import { OAuth } from 'meteor/oauth';

Deploy a Meteor app on a dedicated linux server

Requirement

You need, Meteor, MongoDB and Node.js installed on the machine.

And it also requires the forever npm package to be globaly installed.

Deploy script to copy/past in shell ⚠️ NOT AS ROOT

Be sure to replace the CAPITALIZED words with you own and to adapt the meteor npm install ... to your dependencies from your package.json file