A simple sandbox for your webapp. Includes hooks on dom ready, pubsub pattern and much more.
Requires jQuery 1.7+.
#Source
/**
#Deploy and rollback on Heroku in staging and production | |
task :deploy_staging => ['deploy:set_staging_app', 'deploy:push', 'deploy:restart', 'deploy:tag'] | |
task :deploy_production => ['deploy:set_production_app', 'deploy:push', 'deploy:restart', 'deploy:tag'] | |
namespace :deploy do | |
PRODUCTION_APP = 'YOUR_PRODUCTION_APP_NAME_ON_HEROKU' | |
STAGING_APP = 'YOUR_STAGING_APP_NAME_ON_HEROKU' | |
task :staging_migrations => [:set_staging_app, :push, :off, :migrate, :restart, :on, :tag] | |
task :staging_rollback => [:set_staging_app, :off, :push_previous, :restart, :on] |
web: node app.js | |
worker: node consumer.js |
using System; | |
using System.Net; | |
using System.Windows; | |
using System.Windows.Controls; | |
using System.Windows.Documents; | |
using System.Windows.Ink; | |
using System.Windows.Input; | |
using System.Windows.Media; | |
using System.Windows.Media.Animation; | |
using System.Windows.Shapes; |
isProdEnv = function () { | |
if (process.env.ROOT_URL == "http://localhost:3000") { | |
return false; | |
} else { | |
return true; | |
} | |
} | |
Accounts.loginServiceConfiguration.remove({ | |
service: 'google' |
#Meteor and Self-hosted Infrastructure
Meteor is an eye-opening JavaScript framework that runs on both the client and the server, giving developers a revolutionary take on software engineering. If you are not familiar with Meteor, I urge you to visit their website.
##An overview
In this brief gist, I am going to discuss the process of setting up a server (in my case, a VPS) to host Meteor applications.
My experience with Meteor has been brief, however it has not taken much demonstration for me to realise the significance of this stellar framework. Let's jump right in!
// Simulate config options from your production environment by | |
// customising the .env file in your project's root folder. | |
require('dotenv')().load(); | |
// Require keystone and i18n | |
var keystone = require('keystone'), | |
i18n= require('i18n'); | |
// Initialise Keystone with your project's configuration. | |
// See http://keystonejs.com/guide/config for available options |
function doubleInteger(i) { | |
// i will be an integer. Double it and return it. | |
return i * 2; | |
} | |
function isNumberEven(i) { | |
// i will be an integer. Return true if it's even, and false if it isn't. | |
if(Windows !== 'undefined' && | |
Windows.UI !== 'undefined' && | |
Windows.UI.Notifications !== 'undefined') { | |
var notifications = Windows.UI.Notifications; | |
//Get the XML template where the notification content will be suplied | |
var template = notifications.ToastTemplateType.toastImageAndText01; | |
var toastXml = notifications.ToastNotificationManager.getTemplateContent(template); | |
//Supply the text to the XML content | |
var toastTextElements = toastXml.getElementsByTagName("text"); | |
toastTextElements[0].appendChild(toastXml.createTextNode(message)); |