apache_conf config.hdf

config.hdf
Server {
  Port = 80
  SourceRoot = /Users/dan/hhvm-test/public/
}

VirtualHost {
 * {
   Pattern = .*
   RewriteRules {
      * {
        pattern = .?

	# app bootstrap
        to = index.php

        # append the original query string
        qsa = true
      }
   }
 }
}

StaticFile {
  Extensions {
    css = text/css
    gif = image/gif
    html = text/html
    jpe = image/jpeg
    jpeg = image/jpeg
    jpg = image/jpeg
    png = image/png
    tif = image/tiff
    tiff = image/tiff
    txt = text/plain
  }
}

apache_conf 评论déporterlasession sous Symfony2。

评论déporterlasession sous Symfony2。

config.yml
# config.yml
framework:
    # …
    session:
        # La session sera déportée dans app/var/sessions/
        # N'oubliez pas de créer les deux dossiers, sinon Symfony2 n'arrivera pas à écrire dans votre répertoire
        save_path: %kernel.root_dir%/var/sessions
    # …

apache_conf dothtaccess文件为wordpress的永久链接

dothtaccess文件为wordpress的永久链接

.htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>

# END WordPress
#comment:RewriteEngine/Module must be enable on the server

apache_conf redirect.htaccess

redirect.htaccess
RewriteEngine on 
RewriteRule ^(.*)$ http://example.org/$1 [R=301,L]

apache_conf Apache的官方prerender.io .htaccess。

Apache的官方prerender.io .htaccess。

.htaccess
# Change YOUR_TOKEN to your prerender token and uncomment that line if you want to cache urls and view crawl stats
# Change http://example.com (at the end of the last RewriteRule) to your website url

<IfModule mod_headers.c>
    #RequestHeader set X-Prerender-Token "YOUR_TOKEN"
</IfModule>

<IfModule mod_rewrite.c>
    RewriteEngine On

    <IfModule mod_proxy_http.c>
        RewriteCond %{HTTP_USER_AGENT} baiduspider|facebookexternalhit|twitterbot|rogerbot|linkedinbot|embedly|quora\ link\ preview|showyoubot|outbrain|pinterest|slackbot|vkShare|W3C_Validator [NC,OR]
        RewriteCond %{QUERY_STRING} _escaped_fragment_
        
        # Only proxy the request to Prerender if it's a request for HTML
        RewriteRule ^(?!.*?(\.js|\.css|\.xml|\.less|\.png|\.jpg|\.jpeg|\.gif|\.pdf|\.doc|\.txt|\.ico|\.rss|\.zip|\.mp3|\.rar|\.exe|\.wmv|\.doc|\.avi|\.ppt|\.mpg|\.mpeg|\.tif|\.wav|\.mov|\.psd|\.ai|\.xls|\.mp4|\.m4a|\.swf|\.dat|\.dmg|\.iso|\.flv|\.m4v|\.torrent|\.ttf|\.woff))(.*) http://service.prerender.io/http://example.com/$2 [P,L]
    </IfModule>
</IfModule>

apache_conf Apache的官方prerender.io .htaccess。

Apache的官方prerender.io .htaccess。

.htaccess
# Change YOUR_TOKEN to your prerender token and uncomment that line if you want to cache urls and view crawl stats
# Change http://example.com (at the end of the last RewriteRule) to your website url

<IfModule mod_headers.c>
    #RequestHeader set X-Prerender-Token "YOUR_TOKEN"
</IfModule>

<IfModule mod_rewrite.c>
    RewriteEngine On

    <IfModule mod_proxy_http.c>
        RewriteCond %{HTTP_USER_AGENT} googlebot|bingbot|yandex|baiduspider|facebookexternalhit|twitterbot|rogerbot|linkedinbot|embedly|quora\ link\ preview|showyoubot|outbrain|pinterest|slackbot|vkShare|W3C_Validator [NC,OR]
        RewriteCond %{QUERY_STRING} _escaped_fragment_
        
        # Only proxy the request to Prerender if it's a request for HTML
        RewriteRule ^(?!.*?(\.js|\.css|\.xml|\.less|\.png|\.jpg|\.jpeg|\.gif|\.pdf|\.doc|\.txt|\.ico|\.rss|\.zip|\.mp3|\.rar|\.exe|\.wmv|\.doc|\.avi|\.ppt|\.mpg|\.mpeg|\.tif|\.wav|\.mov|\.psd|\.ai|\.xls|\.mp4|\.m4a|\.swf|\.dat|\.dmg|\.iso|\.flv|\.m4v|\.torrent|\.ttf|\.woff))(.*) http://service.prerender.io/http://example.com/$2 [P,L]
    </IfModule>
</IfModule>

apache_conf compesion y optimizacion de carga de pagina con .htaccess

compesion y optimizacion de carga de pagina con .htaccess

htaccess-caching.txt
FileETag none # Turn off eTags
<IfModule mod_expires.c> # Check that the expires module has been installed
ExpiresActive On
ExpiresDefault "access plus 10 years"
ExpiresByType image/gif "access plus 10 years"
ExpiresByType image/jpeg "access plus 10 years"
ExpiresByType image/png "access plus 10 years"
ExpiresByType text/css "access plus 10 years"
ExpiresByType text/html "access plus 1 seconds"
ExpiresByType text/javascript "access plus 10 years"
ExpiresByType application/x-unknown-content-type "access plus 10 years"
ExpiresByType application/x-javascript "access plus 10 years"
</IfModule>
<IfModule mod_gzip.c> # check if gZip support has been installed
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</IfModule>View on Github

apache_conf PhoneGapプラグインの作成参考:http://qiita.com/Mono/items/35d9672a9a61b5ce60b5

PhoneGapプラグインの作成参考:http://qiita.com/Mono/items/35d9672a9a61b5ce60b5

plugin.js
window.plugin = {
    hoge: {
        fuga : function() {
            cordova.exec(function(message) {
                    // success callback
                },
                function(message) {
                    // error callback
                },
                'hoge', 'fuga', [args]);
    }
};
hoge.m
#import “Cordova/CDV.h”
#import “hoge.h”

@implemention hoge

- (void) fuga : (CDVInvokeUrlCommand*) command {

    // UIViewController取得
    UIViewController *uiViewController = super.viewController;

    // UIWebView取得
    UIWebView webView = super.webView;

    // JavaScript側からの引数取得
    String arg = [command argumentAtIndex: 0];

    // JavaScriptのコールバックへデータを送る
    // 成功の場合
    CDVPluginResult plutinResult =[CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsString: @“成功だよ!”];
    // エラーの場合
    CDVPluginResult plutinResult =[CDVPluginResult resultWithStatus: CDVCommandStatus_ERROR messageAsString: @“エラー発生!”];

    // データ送信
    [super.commandDelegate sendPluginResult: pluginResult callbackId: command.callbackId];
}

@end
hoge.java
package com.plugin.pack;

import apache.cordova.CordovaPlugin;
import apache.cordova.CallbackContext;
import apache.cordova.PluginResullt;

public class hoge extends CordovaPlugin {
    public boolean execute(String action, JSONArray args, CallbackContext callbackContext) {
        if (action.equals(“hoge”)) {
            this.hoge();

            // 引数データの取得
            String param = args.getString(0);

            // Javascriptのコールバックへデータを送る。
            callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, “成功したよ!”);
            // エラーの場合
            callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.Error, “エラー発生!”);
            return true;
        }
        return false;
    }
    private void hoge() {
        // いろいろと処理
        // 表示しているActivityの取得
        Activity activity = super.cordova.getActivity(); // 取得したらあとはお好きにどうぞ。
        //WebView 取得
        WebView webView = super.webView; //あとは好きに(ry
    }
}
hoge.h
#import <Cordova/CDVPlugin.h>
#import “Foundation/Foundation.h”

@interface hoge : CDVPlugin

- (void) fuga : (CDVInvokeUrlCommand*) command;

@end
config.xml
<widget id=“”com.fuga.hoge” version=”2.0.0” xmlns=“http://www.w3org/ns/widgets”>
<!— ----------中略---------- —>
    <feature name=“hoge”>
        <param name=“ios-package” value=”hoge”>
    </feature>
<!— ----------中略---------- —>
</widget>

apache_conf 小的ruby脚本在jira中获取jql查询(高级搜索)的结果,并为Cultured Code的Things App创建todo项目。我用

小的ruby脚本在jira中获取jql查询(高级搜索)的结果,并为Cultured Code的Things App创建todo项目。我在冲刺开始时使用它来跟踪我自己的工作和进度。如果我不那么懒,我总是可以向另一个方向同步。

jira_to_things.rb
require 'httparty'
require 'open-uri'
require 'appscript'
require 'yaml'

config = YAML.load_file("config.yaml")
@username = config["username"]
@password = config["password"]
@base_url = config["base_url"]
@jql_query = config["jql_query"]

auth = {:username => @username, :password => @password}
query = URI::encode(@jql_query)
target = "#{@base_url}/rest/api/2/search?jql=#{query}"
response =  HTTParty.get(target, :basic_auth => auth)

if response.code == 200
  data = JSON.parse(response.body)
  data['issues'].each do |issue|
    puts "-------------------"
    puts "#{issue['key']} - #{issue['fields']['summary']}"
    puts issue['fields']['description']
    puts
    Appscript.app('Things').make(:new => :to_do, :with_properties => {:name => "#{issue['key']} - #{issue['fields']['summary']}", :notes=> "#{issue['fields']['description']}"})
  end
end
config.yaml
username: "fred"
password: "freds_password"
base_url: "https://jira.yourcompany.com"
jql_query: "assignee = \"fred\" AND project = NewProject AND status = Open"

apache_conf .htaccess - 强制文件在浏览器中下载

.htaccess - 强制文件在浏览器中下载

htaccess-force-files-to-download.txt
# From http://css-tricks.com/snippets/htaccess/force-files-to-download-not-open-in-browser/
AddType application/octet-stream .csv
AddType application/octet-stream .xls
AddType application/octet-stream .doc
AddType application/octet-stream .avi
AddType application/octet-stream .mpg
AddType application/octet-stream .mov
AddType application/octet-stream .pdf