next.js, nginx, reverse-proxy, ssl
$ sudo apt-get update
$ sudo apt-get install nginx letsencrypt
<?php | |
/** | |
* The __halt_compiler() function will stop the PHP compiler when called. | |
* You can then use the __COMPILER_HALT_OFFSET__ constant to grab the contents of the PHP file after the halt. | |
* In this example a PHP template is stored after the halt, to allow simple separation of logic from templating. | |
* The template is stored in a temporary file so it can be included and parsed. | |
* | |
* See: https://github.com/bobthecow/mustache.php/blob/dev/src/Mustache/Loader/InlineLoader.php | |
* http://php.net/manual/en/function.halt-compiler.php | |
*/ |
######################### | |
# .gitignore file for Xcode4 and Xcode5 Source projects | |
# | |
# Apple bugs, waiting for Apple to fix/respond: | |
# | |
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation? | |
# | |
# Version 2.6 | |
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects | |
# |
This gist assumes:
#!/bin/bash | |
# | |
# /etc/init.d/gearman-workers | |
### BEGIN INIT INFO | |
# Provides: gearman-workers | |
# Required-Start: $network $remote_fs $syslog | |
# Required-Stop: $network $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 |
<?php | |
/** | |
* Place this file in the webroot of your project, | |
* access it through http://project.dev/tests.php or http://localhost/project/webroot/tests.php | |
* | |
* Assuming you have defined a BASEPATH to the root of your project and | |
*/ | |
define('BASEPATH', __DIR__.'/..'); // root of project, this one assumes /project/webroot/tests.php | |
define('LOCATION', BASEPATH .'/app'); // in a SF2 project, this is where the phpunit.xml file is |
* GET /posts {"controller":"posts","action":"index"} | |
* GET /posts/{:id:\d+} {"controller":"posts","action":"show"} | |
* GET /posts/add {"controller":"posts","action":"add"} | |
* PUT /posts {"controller":"posts","action":"create"} | |
* GET /posts/{:id:\d+}/edit {"controller":"posts","action":"edit"} | |
* POST /posts/{:id:\d+} {"controller":"posts","action":"update"} | |
* DELETE /posts/{:id:\d+} {"controller":"posts","action":"delete"} |
<?php | |
file_put_contents( 'progress.txt', '' ); | |
$targetFile = fopen( 'testfile.iso', 'w' ); | |
$ch = curl_init( 'http://ftp.free.org/mirrors/releases.ubuntu-fr.org/11.04/ubuntu-11.04-desktop-i386-fr.iso' ); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt( $ch, CURLOPT_NOPROGRESS, false ); | |
curl_setopt( $ch, CURLOPT_PROGRESSFUNCTION, 'progressCallback' ); | |
curl_setopt( $ch, CURLOPT_FILE, $targetFile ); |
sudo apt-get install libjpeg8-dev libmysqlclient-dev | |
curl -O http://www.php.net/get/php-5.3.5.tar.gz/from/a/mirror | |
curl -O http://mirror.bjtu.edu.cn/apache//httpd/httpd-2.2.17.tar.gz | |
tar zxf httpd-2.2.17.tar.gz | |
cd httpd-2.2.17 | |
./configure --prefix=/etc/apache2 --enable-so --enable-cgi --enable-info --enable-rewrite \ | |
--enable-speling --enable-usertrack --enable-deflate --enable-ssl --enable-mime-magic \ | |
--enable-dav --enable-vhost-alias --enable-proxy --enable-expires --enable-headers | |
make && sudo make install | |
require "thor/shell" | |
say("Modifying a new Rails app ...", :yellow) | |
#---------------------------------------------------------------------------- | |
# Configure | |
#---------------------------------------------------------------------------- | |
=begin | |
unless options[:database] == 'sqlite3' | |
username = ask("What's your database username[root]") | |
username = 'root' if username.blank? |