This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.
Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).
This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.
Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).
| #!/bin/bash | |
| # SSH into a Vagrant VM, forwarding ports in a way that allows node within Vagrant to be debugged by a debugger | |
| # or IDE in the host operating system. Don't know why, but Vagrantfile port forwarding does not work. | |
| # (https://groups.google.com/forum/#!topic/vagrant-up/RzPooJ0dp6Q) | |
| /usr/bin/vagrant ssh-config > $TMPDIR/vagrant-ssh-config | |
| ssh -F $TMPDIR/vagrant-ssh-config -L 5858:127.0.0.1:5858 default | |
| rm $TMPDIR/vagrant-ssh-config |
| import pygame | |
| from random import choice | |
| class Cell(pygame.sprite.Sprite): | |
| w, h = 16, 16 | |
| def __init__(self, x, y, maze): | |
| pygame.sprite.Sprite.__init__(self) |
| <html> | |
| <body> | |
| <h2>Privacy Policy</h2> | |
| <p>[Individual or Company Name] built the [App Name] app as a [open source | free | freemium | ad-supported | commercial] app. This SERVICE is provided by [Individual or company name] [at no cost] and is intended | |
| for use as is.</p> | |
| <p>This page is used to inform website visitors regarding [my|our] policies with the collection, use, and | |
| disclosure of Personal Information if anyone decided to use [my|our] Service.</p> | |
| <p>If you choose to use [my|our] Service, then you agree to the collection and use of information in | |
| relation with this policy. The Personal Information that [I|we] collect are used for providing and | |
| improving the Service. [I|We] will not use or share your information with anyone except as described |
Trickier than it seems.
Let's assume that you've already created an unprivileged user named myapp. You should never run your Node.js applications as root!
Switch to the myapp user, and do the following:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash (however, this will immediately run the nvm installer - you probably want to just download the install.sh manually, and inspect it before running it)nvm install stable| var app = express(); | |
| app.io = require('socket.io')(); | |
| var routes = require('./routes/index')(app.io); | |
| app.use('/', routes); |
| // This script will boot app.js with the number of workers | |
| // specified in WORKER_COUNT. | |
| // | |
| // The master will respond to SIGHUP, which will trigger | |
| // restarting all the workers and reloading the app. | |
| var cluster = require('cluster'); | |
| var workerCount = process.env.WORKER_COUNT || 2; | |
| // Defines what each worker needs to run |
На iOS устройствах числовые значения подчёркиваются синим. Эта проблема возникает из-за того, что iOS устройства по умолчанию считают все числа похожие на телефонные номера - телефонными номерами. Решается добавлением <meta name="format-detection" content="telephone=no" />
Тоже самое касается адреса: <meta name="format-detection" content="address=no" />
Пользователь может уменьшать и увеличивать приложение. Решается добавляением тега <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
Ссылки нажимаются с задержкой (примерно 300ms). Решается подпиской на событие touchstart и принудительной инициализацией события click после него. Если проблема всё равно возникает - ничего не поделать, надо облегчать dom.
В android появляется синяя обводка вокруг ссылок с характерным звуком. Решение:
| /* Copyright (C) Hola 2012, 2013 | |
| * | |
| * Добро пожаловать на олимпиаду программистов Hola! | |
| * | |
| * ПРАВИЛА: | |
| * - Идеальное решение до 28-May-13 принесет вам 500 долларов США! | |
| * - В случае хорошего (но не идеального) решения, мы вышлем замечания, чтобы | |
| * помочь вам доработать код. | |
| * - Идеальный ответ со второй попытки принесет вам 250 долларов США. | |
| * |