This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from sqlalchemy import URL | |
| from sqlalchemy.ext.asyncio import create_async_engine, async_sessionmaker, AsyncSession | |
| from sqlalchemy.orm import DeclarativeBase | |
| from app.config.setting import settings | |
| """ | |
| main database | |
| """ | |
| connection_url = URL.create( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import scipy.stats as st | |
| import random | |
| apply_a = [] | |
| apply_b = [] | |
| ## AB 两组人数各为 20000 人 | |
| for times in range(20000): | |
| # AB 每组的报名次数 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set nu | |
| set mouse=v | |
| let g:NERDTreeWinPos="left" | |
| let g:NERDTreeWinSize=26 | |
| """""""""""""""""""""""""""""""""" | |
| " => PHP section | |
| """""""""""""""""""""""""""""""""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """"""""""""""""""""""""""""""""" | |
| " https://github.com/amix/vimrc | |
| """"""""""""""""""""""""""""""""" | |
| set nu | |
| set mouse=v | |
| let g:NERDTreeWinPos = "left" | |
| """""""""""""""""""""""""""""""""" | |
| " => PHP section |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| listen 80; | |
| server_name foo.com; | |
| root /path; | |
| index index.html index.htm index.php; | |
| location / { | |
| try_files $uri $uri/ /index.php; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| set $htdocs /home/libaochang/data/orange/public; | |
| listen 80; | |
| server_name xmprs.com; | |
| location / { | |
| root $htdocs; | |
| autoindex on; | |
| index index.php index.html; | |
| if (!-e $request_filename){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Client | |
| <?php | |
| class HTTPClient { | |
| function __construct($url, $port = 80) | |
| { | |
| $this->url = $url; | |
| $this->port = $port; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(document).ready(function(){ | |
| $("#back-top").hide(); | |
| $(function () { | |
| $(window).scroll(function () { | |
| if ($(this).scrollTop() > 100) { | |
| $('#back-top').fadeIn(); | |
| } else { | |
| $('#back-top').fadeOut(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| return array( | |
| 'controllers' => array( | |
| 'invokables' => array( | |
| 'Admin\Controller\Index' => 'Admin\Controller\IndexController', | |
| 'Admin\Controller\Dash' => 'Admin\Controller\DashController', | |
| ), | |
| ), | |
| 'router' => array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Util { | |
| static function domain($output = true) { | |
| $protocol = strpos(strtolower($_SERVER['SERVER_PROTOCOL']),'https'); | |
| $host = $_SERVER["HTTP_HOST"]; | |
| $port = $_SERVER["SERVER_PORT"]; | |
| $domain = (($protocol !== false) ? "https" : "http") . "://" . $host; | |
| $domain .= ($port == "80") ? "" : (":" . $port); |
NewerOlder