- Trocar o
www.mywebsite.com
pelo endereço do site em produção; - Incluir isso no início do seu script.
Se passar o parâmetro ?development
na URL, ele ignora e mostra os console.log()
.
var moment = require('moment'); | |
var inicio = moment().set({hours:'08',minutes:'00'}); | |
var fim = moment().set({hours:'18',minutes:'00'}); | |
for(var interval = inicio; interval < fim; interval.add({hours:1,minutes:30})){ | |
console.log(interval.format('HH:mm')); | |
} |
<?php | |
$datas = new DatePeriod(new DateTime('2015-01-30'), new DateInterval('P1M'), 10); | |
foreach ($datas as $data) { | |
echo $data->format('d/m/Y'), '<br>'; | |
} |
echo '[Unit] | |
Description=High-performance, schema-free document-oriented database | |
After=syslog.target network.target | |
[Service] | |
User=mongodb | |
Group=mongodb | |
ExecStart=/usr/bin/mongod -f /etc/mongod.conf | |
[Install] |
Ansible playbook to setup HTTPS using Let's encrypt on nginx. | |
The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS. | |
The server pass A rating on [SSL Labs](https://www.ssllabs.com/). | |
To use: | |
1. Install [Ansible](https://www.ansible.com/) | |
2. Setup an Ubuntu 16.04 server accessible over ssh | |
3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain | |
4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder) |
// http://locutus.io/php/misc/uniqid/ | |
function uniqid (prefix, moreEntropy) => { | |
if (typeof prefix === 'undefined') { | |
prefix = ''; | |
} | |
let retId; | |
const _formatSeed = function (seed, reqWidth) { | |
seed = parseInt(seed, 10).toString(16); // to hex str | |
if (reqWidth < seed.length) { |
--- | |
## Usage: | |
## ansible-playbook s3-playbook.yml | |
- hosts: localhost | |
connection: local | |
gather_facts: False | |
vars: | |
buckets: | |
'<BucketName>' : '<BucketARN>' | |
'com.example.bucket' : 'arn:aws:s3:::com.example.bucket' |
<?php | |
namespace App\Http\Content\Controllers; | |
use App\Common\Model; | |
use Illuminate\Http\Request; | |
use Illuminate\Http\Response; | |
use Illuminate\Routing\Controller; | |
/** |