apache_conf Sublime Text 2/3:配置设置

Sublime Text 2/3:配置设置

configuration-settings.js
/* CSS formatting for Emmet
Preferences > Package Settings > Emmet > Settings - User:
===============================================*/
{
    "preferences": {
        //Removes the space after the colon
        "css.valueSeparator": ":",
        //Adds a space after the semicolon
        "css.propertyEnd": "; "
    }
}

/* Custom User Settings
Preferences > Settings - User:
===============================================*/
{
	"added_words":
	[
		"isotype"
	],
	"always_show_minimap_viewport": true,
	"caret_style": "phase",
	"color_scheme": "Packages/Theme - Cobalt2/cobalt2.tmTheme",
	"copy_with_empty_selection": false,
	"draw_minimap_border": false,
	"font_options":
	[
		"directwrite"
	],
	"font_size": 11,
	"highlight_line": true,
	"ignored_packages":
	[
		"Vintage"
	],
	"indent_guide_options":
	[
		"draw_normal",
		"draw_active"
	],
	"tab_size": 4,
	"theme": "Cobalt2.sublime-theme",
	"trim_trailing_white_space_on_save": true,
	"spell_check": true,
	"dictionary": "Packages/Language - English/en_US.dic"
}

/* Cobalt2 Theme for icons on files: */
//https://github.com/wesbos/cobalt2


/* Folder path to Projects' file: */
//C:\Users\[Username]\AppData\Roaming\Sublime Text 2\Settings\Session.sublime_session


/* Format HTML tags' content in one line:* /
//http://stackoverflow.com/questions/13143850/sublime-text-2-format-html-tags-content-in-one-line/13145975#13145975 

apache_conf 〜/ .ssh / config设置主机名别名

〜/ .ssh / config设置主机名别名

config
Host staging
Hostname 1.1.1.1

Host production
Hostname 1.1.1.2

apache_conf configCreate.cpp

configCreate.cpp
ConfigCreate::ConfigCreate()
{
}
 
ConfigCreate::~ConfigCreate()
{
}
 
void ConfigCreate::Open(const std::string& filename)
{
    file.open(filename);
    file.clear();
}
 
void ConfigCreate::Close()
{
    file.close();
}
 
void ConfigCreate::PutSection(const std::string& section)
{
    file << "[" << section << "]" << std::endl;
}
 
void ConfigCreate::PutValue(const std::string& key, const std::string& value)
{
    file << key << "=" << value << std::endl;
}
 
void ConfigCreate::PutComment(const std::string& comment)
{
    file << "# " << comment << std::endl;
}
 
void ConfigCreate::PutBlankLine()
{
    file << std::endl;
}

apache_conf configCreate.cpp

configCreate.cpp
ConfigCreate::ConfigCreate()
{
}
 
ConfigCreate::~ConfigCreate()
{
}
 
void ConfigCreate::Open(const std::string& filename)
{
    file.open(filename);
    file.clear();
}
 
void ConfigCreate::Close()
{
    file.close();
}
 
void ConfigCreate::PutSection(const std::string& section)
{
    file << "[" << section << "]" << std::endl;
}
 
void ConfigCreate::PutValue(const std::string& key, const std::string& value)
{
    file << key << "=" << value << std::endl;
}
 
void ConfigCreate::PutComment(const std::string& comment)
{
    file << "# " << comment << std::endl;
}
 
void ConfigCreate::PutBlankLine()
{
    file << std::endl;
}

apache_conf configCreate.hpp

configCreate.hpp
class ConfigCreate
{
public:
    ConfigCreate();
 
    ~ConfigCreate();
 
    void Open(const std::string& filename);
 
    void Close();
 
    void PutSection(const std::string& section);
 
    void PutValue(const std::string& key, const std::string& value);
 
    void PutComment(const std::string& comment);
 
    void PutBlankLine();
 
private:
    std::ofstream file;
 
}; // class ConfigCreate

apache_conf configCreate.hpp

configCreate.hpp
class ConfigCreate
{
public:
    ConfigCreate();
 
    ~ConfigCreate();
 
    void Open(const std::string& filename);
 
    void Close();
 
    void PutSection(const std::string& section);
 
    void PutValue(const std::string& key, const std::string& value);
 
    void PutComment(const std::string& comment);
 
    void PutBlankLine();
 
private:
    std::ofstream file;
 
}; // class ConfigCreate

apache_conf 停电页面

停电页面

outage.html
<title>Site Offline</title>
<style>
        body { text-align: center; font: 12px/1.3 'Helvetica Neue',Helvetica,Arial,sans-serif; color: #999; text-shadow: 0 1px 0 #fff; background: #eee; }
        img { margin-top: 200px; border-radius: 10px; }
        h1 { font-size: 24px; text-align: center; }
        article { display:block; width: 500px; margin: 0 auto; }
        hr { height: 1px; background: #ccc; border: 0 none; }
        a { color: #555; text-decoration:none; }
</style>

<article>

        <img src="http://i.imgur.com/8hq6AKs.gif" alt="">
        <h1>Site Offline</h1>
        <div>
                <p>This site is currently offline for maintenance. Check back soon.</p>
                <hr>
                <p>If you need immediate assistance, please <a href="https://tagboard.wufoo.com/forms/m7x3r3/">contact us</a>.</p>
        </div>

</article>
.htaccess
<IfModule mod_rewrite.c>
   RewriteEngine on
   RewriteCond %{REQUEST_URI} !.*index\.html
   RewriteRule (.*) /index.html
</IfModule>

apache_conf 来自https://snipt.net/public/ .htaccess HTTP缓存(Google PageSpeed Friendly)

来自https://snipt.net/public/ .htaccess HTTP缓存(Google PageSpeed Friendly)

htaccess
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault "access plus 1 seconds"
    ExpiresByType text/html "access plus 1 seconds"
    ExpiresByType image/gif "access plus 1 week"
    ExpiresByType image/jpeg "access plus 1 week"
    ExpiresByType image/png "access plus 1 week"
    ExpiresByType text/css "access plus 1 week"
    ExpiresByType text/javascript "access 1 week"
    ExpiresByType application/x-javascript "access plus 1 week"
    ExpiresByType application/javascript "access plus 1 week"
    ExpiresByType text/xml "access plus 60 minutes"
</IfModule>

apache_conf Configurar Charset por defecto en .htaccess

Configurar Charset por defecto en .htaccess

.htaccess
AddDefaultCharset utf-8

apache_conf 试图让Ghost与MySQL合作......没有运气......但......

试图让Ghost与MySQL合作......没有运气......但......

config.js
// # Ghost Configuration
// Setup your Ghost install for various environments

var path = require('path'),
    config;

config = {
    // ### Development **(default)**
    development: {
        // The url to use when providing links to the site, E.g. in RSS and email.
        url: 'http://my-ghost-blog.com',

        // Example mail config
        // Visit http://docs.ghost.org/mail for instructions
        // ```
        //  mail: {
        //      transport: 'SMTP',
        //      options: {
        //          service: 'Mailgun',
        //          auth: {
        //              user: '', // mailgun username
        //              pass: ''  // mailgun password
        //          }
        //      }
        //  },
        // ```

        mail: {
            fromaddress: 'myemail@address.com',
        },
        database: {
            client: 'mysql',
            connection: {
                host     : '127.0.0.1',
                user     : 'ghost',
                password : 'ghost',
                database : 'ghost',
                charset  : 'utf8'
            },
            debug: false
        },
        server: {
            // Host to be passed to node's `net.Server#listen()`
            host: '127.0.0.1',
            // Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT`
            port: '80'
        }
    },

    // ### Production
    // When running Ghost in the wild, use the production environment
    // Configure your URL and mail settings here
    production: {
        url: 'http://my-ghost-blog.com',
        mail: {},
        database: {
            client: 'mysql',
            connection: {
                host     : '127.0.0.1',
                user     : 'ghost',
                password : 'ghost',
                database : 'ghost',
                charset  : 'utf8'
            },
            debug: false
        },
        server: {
            // Host to be passed to node's `net.Server#listen()`
            host: '127.0.0.1',
            // Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT`
            port: '2368'
        }
    },

    // **Developers only need to edit below here**

    // ### Testing
    // Used when developing Ghost to run tests and check the health of Ghost
    // Uses a different port number
    testing: {
        url: 'http://127.0.0.1:2369',
        mail: {},
        database: {
            client: 'mysql',
            connection: {
                host     : '127.0.0.1',
                user     : 'ghost',
                password : 'ghost',
                database : 'ghost',
                charset  : 'utf8'
            }
        },
        server: {
            host: '127.0.0.1',
            port: '2369'
        }
    },

    // ### Travis
    // Automated testing run through Github
    travis: {
        url: 'http://127.0.0.1:2368',
        database: {
            client: 'sqlite3',
            connection: {
                filename: path.join(__dirname, '/content/data/ghost-travis.db')
            }
        },
        server: {
            host: '127.0.0.1',
            port: '2368'
        }
    }
};

// Export config
module.exports = config;