markdown XAMPP - Oracle驱动程序安装(v12)

XAMPP - Oracle驱动程序安装(v12)

php-oracle.md
# XAMPP - Oracle Driver Setup (v12)

## Setup

Testest with PHP 5.6, 7.0, 7.1.

* Download the Oracle Instant Client for Microsoft Windows (32-bit) v.12
 http://www.oracle.com/technetwork/topics/winsoft-085727.html
* Unzip file: `instantclient-basiclite-nt-12.2.0.1.0.zip`
* Copy all *.dll files: to `c:\xampp\php`
* Copy all *.dll files to `c:\xampp\apache\bin` (Yes, a second copy!)
* Enable php extension in php.ini: `extension=php_oci8_12c.dll`
* Restart Apache
* Click at the Github ★ Star :-)

## Connection test
```php
<?php

error_reporting(E_ALL);

if (function_exists("oci_connect")) {
    echo "oci_connect found\n";
} else {
    echo "oci_connect not found\n";
    exit;
}

$host = 'localhost';
$port = '1521';

// Oracle service name (instance)
$db_name     = 'DBNAME';
$db_username = "USERNAME";
$db_password = "123456";

$tns = "(DESCRIPTION =
	(CONNECT_TIMEOUT=3)(RETRY_COUNT=0)
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = $host)(PORT = $port))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = $db_name)
    )
  )";
$tns = "$host:$port/$db_name";

try {
    $conn = oci_connect($db_username, $db_password, $tns);
    if (!$conn) {
        $e = oci_error();
        throw new Exception($e['message']);
    }
    echo "Connection OK\n";
    
    $stid = oci_parse($conn, 'SELECT * FROM ALL_TABLES');
    
    if (!$stid) {
        $e = oci_error($conn);
        throw new Exception($e['message']);
    }
    // Perform the logic of the query
    $r = oci_execute($stid);
    if (!$r) {
        $e = oci_error($stid);
        throw new Exception($e['message']);
    }
    
    // Fetch the results of the query
    while ($row = oci_fetch_array($stid, OCI_ASSOC + OCI_RETURN_NULLS)) {
        $row = array_change_key_case($row, CASE_LOWER);
        print_r($row);
        break;
    }
    
    // Close statement
    oci_free_statement($stid);
    
    // Disconnect
    oci_close($conn);
    
}
catch (Exception $e) {
    print_r($e);
}
```

markdown README.md

pypod.py
#!/usr/bin/env python
#-*- coding:utf-8 -*-

import httplib, urllib
import socket
import time

params = dict(
    login_email="email", # replace with your email
    login_password="password", # replace with your password
    format="json",
    domain_id=100, # replace with your domain_od, can get it by API Domain.List
    record_id=100, # replace with your record_id, can get it by API Record.List
    sub_domain="www", # replace with your sub_domain
    record_line="默认",
)
current_ip = None

def ddns(ip):
    params.update(dict(value=ip))
    headers = {"Content-type": "application/x-www-form-urlencoded", "Accept": "text/json"}
    conn = httplib.HTTPSConnection("dnsapi.cn")
    conn.request("POST", "/Record.Ddns", urllib.urlencode(params), headers)
    
    response = conn.getresponse()
    print response.status, response.reason
    data = response.read()
    print data
    conn.close()
    return response.status == 200

def getip():
    sock = socket.create_connection(('ns1.dnspod.net', 6666))
    ip = sock.recv(16)
    sock.close()
    return ip
    
def getIpFrom_ip138():
    conn = httplib.HTTPConnection('iframe.ip138.com')
    conn.request("GET", "/ic.asp")
    result = conn.getresponse().read()
    conn.close()

    m = re.search("([\d]+(\.)+[\d]+(\.)+[\d]+(\.)+[\d]+)+", result)
    if m:
        return m.group(0)
    else:
        return getip()
        
if __name__ == '__main__':
    while True:
        try:
            ip = getIpFrom_ip138()
            print ip
            if current_ip != ip:
                if ddns(ip):
                    current_ip = ip
        except Exception, e:
            print e
            pass
        time.sleep(30)
README.md
替换上你的Email,密码,域名ID,记录ID等参数,就可以运行了。
会在后台一直运行,每隔30秒检查一遍IP,如果修改了就更新IP。

获得domain_id可以用curl
`curl -k https://dnsapi.cn/Domain.List -d "login_email=xxx&login_password=xxx"`

获得record_id类似
`curl -k https://dnsapi.cn/Record.List -d "login_email=xxx&login_password=xxx&domain_id=xxx"`

markdown git日志过滤器

git log过滤不合并,因为

git-command.md
`git log origin/uat --no-merges --since=2017-09-01`

check last commit change
```
git diff HEAD^1
```

markdown Google优化延迟问题

issue.md
````
https://dbd-pm.scmp.com/issues/20491
````

markdown 欢迎来到Cacher

以下是一些可帮助您开始构建代码段库的提示。

cacher_intro.md
# Getting Started with Cacher

<p align="center">
<img src="http://www.cacher.io/assets/intro-snippet-splash-a90755aca4db13aac1e5140e8d7c2a7c01d9b69a640e51b55093421dff432039.png" width="480" />
</p>


## Use snippets to quickly recall commands

Snippets are the most useful when you want to re-use a shell command or a specific code pattern. Here are a few we have in our library:
- "How to delete a git tag"
- "Nginx configuration for staging server"
- "Crash handler AWS Lambda function"

## Use snippets for customer service

Engineers are often second-line customer agents. Use Cacher to store snippets for performing common support tasks.

## Labels are your friend

Labels are a great way to organize your snippets. A good practice is to have one for every major product feature. We've created the first label for you - **Documentation**.

## Create or join a team to share knowledge

Teams allow you and your colleagues to build a shared knowledge base. Use [Markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) to write beautifully formatted documentation. (This snippet itself is a Markdown file.)

## Use snippets for onboarding new team members

Let's face it. Having the new engineer decipher a 500 thousand-line codebase might not be an efficient use of her time. Use snippets as examples to help new members get up to speed fast.


markdown 使用yarn更新节点模块

这类似于npm-check交互更新模式。它提供了一种更新过时软件包的简便方法。

updateWithYarn
```
$ yarn upgrade-interactive
```

markdown Nodejs广告时段/大小

广告位大小

issue.md
````
https://dbd-pm.scmp.com/issues/20194
````
````
https://dbd-pm.scmp.com/issues/20192
````

````
https://dbd-pm.scmp.com/issues/20348
````

markdown ABC

ABC

abc.md
123

markdown 欢迎来到Cacher

以下是一些可帮助您开始构建代码段库的提示。

cacher_intro.md
# Getting Started with Cacher

<p align="center">
<img src="http://www.cacher.io/assets/intro-snippet-splash-a90755aca4db13aac1e5140e8d7c2a7c01d9b69a640e51b55093421dff432039.png" width="480" />
</p>


## Use snippets to quickly recall commands

Snippets are the most useful when you want to re-use a shell command or a specific code pattern. Here are a few we have in our library:
- "How to delete a git tag"
- "Nginx configuration for staging server"
- "Crash handler AWS Lambda function"

## Use snippets for customer service

Engineers are often second-line customer agents. Use Cacher to store snippets for performing common support tasks.

## Labels are your friend

Labels are a great way to organize your snippets. A good practice is to have one for every major product feature. We've created the first label for you - **Documentation**.

## Create or join a team to share knowledge

Teams allow you and your colleagues to build a shared knowledge base. Use [Markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) to write beautifully formatted documentation. (This snippet itself is a Markdown file.)

## Use snippets for onboarding new team members

Let's face it. Having the new engineer decipher a 500 thousand-line codebase might not be an efficient use of her time. Use snippets as examples to help new members get up to speed fast.


markdown Druap - 设置env变量,检查env

文件设置env变量,并检查生产或uat的env

env-setting.md
#### setup env variable
````
sites/all/modules/features/scmp_base/scmp_base.env.inc
````

#### check env
```
$environment = environment_current();
if($environment != 'production' && $environment != 'production_alicloud') {
    $filename = 'test_' . $filename;
  }
```