A simple sandbox for your webapp. Includes hooks on dom ready, pubsub pattern and much more.
Requires jQuery 1.7+.
#Source
/**
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. | |
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; |
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)); |
#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!
#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] |
isProdEnv = function () { | |
if (process.env.ROOT_URL == "http://localhost:3000") { | |
return false; | |
} else { | |
return true; | |
} | |
} | |
Accounts.loginServiceConfiguration.remove({ | |
service: 'google' |
In open Ubuntu 18.04 machine click Parallels Actions -> "Install Parallels Tools"
A "Parallels Tools" CD will popup on your Ubuntu desktop.
Open it by double mouse click, copy all the content to a new, empty directory on a desktop, name it for e.g. "parallels_fixed"
Open terminal, change directory to parallels_fixed (cd ~/Desktop/parallels_fixed
)
Make command line installer executable (chmod +x install
)
Change directory to "installer" (cd installer
)
Make few other scripts executable: chmod +x installer.* *.sh prl_*
// 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 |