Skip to content

Instantly share code, notes, and snippets.

View guanguans's full-sized avatar
🏠
Working from home

guanguans guanguans

🏠
Working from home
View GitHub Profile
@guanguans
guanguans / listen1_aha_playlist.md
Last active September 22, 2019 04:47
updated by Listen1(http://listen1.github.io/listen1/) at 2018/11/16 下午12:19:16

本歌单由Listen1创建, 歌曲数:2726,歌单数:15,点击查看更多

@guanguans
guanguans / function.php
Last active December 21, 2020 06:58
function
<?php
if (! function_exists('format_number')) {
/**
* 格式化数字
*
* @param float|int $number
* @param string $rule
* @param int $depth
*
@guanguans
guanguans / listen1_aha_playlist.md
Last active January 3, 2019 07:30
updated by Listen1(http://listen1.github.io/listen1/) at 2019/1/3 下午3:30:34

本歌单由Listen1创建, 歌曲数:3052,歌单数:18,点击查看更多

@guanguans
guanguans / php.php
Last active June 3, 2020 03:12
注释.php
<?php
/**.-----------------------------------------------
* | Author: guanguans <yzmguanguan@gmail.com>
* | Date: 2018-12-27 12:20
* '---------------------------------------------*/
@guanguans
guanguans / listen1_aha_playlist.md
Last active March 1, 2019 12:14
updated by Listen1(http://listen1.github.io/listen1/) at 2019/3/1 下午8:14:39

本歌单由Listen1创建, 歌曲数:3034,歌单数:22,点击查看更多

@guanguans
guanguans / 12306.js
Last active March 14, 2019 03:55
12306.js
function loadScript(url, callback){
var script = document.createElement ("script")
script.type = "text/javascript";
if (script.readyState){ //IE
script.onreadystatechange = function(){
if (script.readyState == "loaded" || script.readyState == "complete"){
script.onreadystatechange = null;
script.parentNode.removeChild(script);
callback();
}
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"stopOnEntry": false,
; NOTE: The actual debug.so extention is NOT SET HERE but rather (/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini)
; xdebug.remote_host=dockerhost
; xdebug.remote_host=docker.for.mac.localhost 此处有坑,这是以前的写法,现在用下条
xdebug.remote_host=docker.for.mac.host.internal
xdebug.remote_connect_back=0
xdebug.remote_port=9000
xdebug.idekey=PHPSTORM
xdebug.remote_autostart=1
@guanguans
guanguans / vscode-launch.json
Last active June 1, 2020 10:44
vscode-launch.json
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
@guanguans
guanguans / pow.php
Last active March 14, 2019 03:54
位运算表示状态
<?php
function getHourInt($timeArray)
{
$val = 0;
for ($i = 0; $i <= 23; $i++) {
if (in_array($i . '', $timeArray)) {
$val |= pow(2, $i + 1);
}
}