- Update CentOS with the following command
yum check-update
yum update
# Rewrite non /app/build/ requests to /app/build/ | |
RewriteCond %{REQUEST_URI} !^/app/build/ | |
RewriteRule ^(.*)$ /app/build/$1 [L] | |
# Rewrite requests to non-existing files/dirs to /app/build/index.html | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d |
<?php | |
/** | |
* @Rami jamleh - http://php.net/manual/en/pdostatement.execute.php#111823 | |
* @Clair_Shaw(Revision) - http://php.net/manual/en/pdostatement.execute.php#116901 | |
* simplified $placeholder form | |
**/ | |
$data = ['a'=>'foo','b'=>'bar']; | |
$keys = array_keys($data); | |
$fields = '`'.implode('`, `',$keys).'`'; | |
//$placeholder = substr(str_repeat('?,',count($keys),0,-1)); |
const puppeteer = require('puppeteer'); | |
(async () => { | |
const browser = await puppeteer.launch({ headless: false }); | |
const page = await browser.newPage(); | |
await page.goto('https://test-navlang-demo-vvkpjvrhym.now.sh'); | |
await page.setViewport({ width: 1380, height: 900 }); | |
await page.waitFor(1000); | |
const page2 = await browser.newPage(); |
yum check-update
yum update
WebSockets is a modern HTML5 standard which makes communication between client and server a lot more simpler than ever. We are all familiar with the technology of sockets. Sockets have been fundamental to network communication for a long time but usually the communication over the browser has been restricted. The general restrictions
Full blog post can be found here: http://pnommensen.com/2014/09/07/high-performance-ghost-configuration-with-nginx/
Ghost is an open source platform for blogging founded by John O'Nolan and Hannah Wolfe. It's a node.js application and therefore works great in conjunction with nginx. This guide will will help you create a high performance nginx virtual host configuration for Ghost.
"Don't use #nodejs for static content" - @trevnorris. If #nginx isn't sitting in front of your node server, you're probably doing it wrong.
— Bryan Hughes (@nebrius) August 30, 2014
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
The node.js application runs on a port on your server
var app = require('express')() | |
, server = require('http').createServer(app) | |
, io = require('socket.io').listen(server); | |
server.listen(3012); | |
app.get('/', function (req, res) { | |
res.sendfile(__dirname + '/index.html'); | |
}); |
#Linux - Running a Node Service (PM2) PM2 is a replacement for Forever which is used to run Node services (see http://devo.ps/blog/2013/06/26/goodbye-node-forever-hello-pm2.html). It has a number of advantages over forever:
<script type='text/javascript'> | |
jwplayer("PLAYER_ID").setup({ | |
flashplayer: "/jwplayer/player.swf", | |
controlbar: "bottom", | |
dock:false, | |
file: "AUDIO/VIDEO FILENAME", | |
streamer: "rtmp://STREAMING-DISTRIBUTION-DOMAIN-NAME/cfx/st", | |
width: "162", | |
height: "24", | |
}); |
// this is the background code... | |
// listen for our browerAction to be clicked | |
chrome.browserAction.onClicked.addListener(function (tab) { | |
// for the current tab, inject the "inject.js" file & execute it | |
chrome.tabs.executeScript(tab.ib, { | |
file: 'inject.js' | |
}); | |
}); |