Install composer locally (current user only):
wget -O - https://gist.github.com/EmpireWorld/1dd5f59566e186907f99dc16badc382a/raw/install-composer-local.sh | bash
Install composer globally (all users):
proxy_cache_path /tmp/cacheapi levels=1:2 keys_zone=microcacheapi:100m max_size=1g inactive=1d use_temp_path=off; | |
server { | |
listen 443 ssl http2 default_server; | |
listen [::]:443 ssl http2 default_server; | |
server_name example.com; | |
location /api/ { | |
# Rate Limiting | |
limit_req zone=reqlimit burst=20; # Max burst of request |
#!/usr/bin/env bash | |
# used to install offical chrome and selenium on Ubuntu 16.04.1 LTS, Jan 2019 | |
cd ~ | |
sudo apt-get update | |
sudo apt install python-pip | |
pip install simplejson | |
pip install bs4 | |
pip install selenium | |
apt-get install libasound2 libnspr4 libnss3 libxss1 xdg-utils unzip | |
sudo apt-get install -y libappindicator1 fonts-liberation |
#!/bin/bash | |
# from https://chromium.woolyss.com/ | |
# and https://gist.github.com/addyosmani/5336747 | |
# and https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md | |
sudo apt-get update | |
sudo apt-get install software-properties-common | |
sudo add-apt-repository ppa:canonical-chromium-builds/stage | |
sudo apt-get update | |
sudo apt-get install chromium-browser | |
chromium-browser --headless --no-sandbox http://example.org/ |
/*
Made by [egy.js](https://www.instagram.com/egy.js/);
*/
php -v
PHP 5.6.3 (cli) (built: Oct 28 2015 09:47:41)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies
But this only changes in CLI. You have to tweak you nginx(same for apache) to make it works. Nginx will still using the native PHP-FPM.
> ps aux | grep php-fpm
(defn ignore-trailing-slash | |
"Modifies the request uri before calling the handler. | |
Removes a single trailing slash from the end of the uri if present. | |
Useful for handling optional trailing slashes until Compojure's route matching syntax supports regex. | |
Adapted from http://stackoverflow.com/questions/8380468/compojure-regex-for-matching-a-trailing-slash" | |
[handler] | |
(fn [request] | |
(let [uri (:uri request)] | |
(handler (assoc request :uri (if (and (not (= "/" uri)) |
// | |
// SWebSocket.cpp | |
// | |
// Created by Yoshiaki Sugimoto on 2014/08/04. | |
// | |
// | |
#include "SWebSocket.h" | |
USING_NS_CC; |
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
var Article = require('../../../models/article');
Those suck for maintenance and they're ugly.