This file contains 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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"github.com/elliotchance/phpserialize" | |
"strings" | |
) | |
type job struct { |
This file contains 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
// cnet/net.go | |
package cnet | |
import ( | |
"fmt" | |
"log" | |
"net" | |
"os" | |
"strconv" | |
"strings" |
This file contains 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
#!/bin/bash | |
U=${SUDO_USER:=${USER}} | |
if [[ -x `which realpath` ]]; then | |
T=$(realpath ${BASH_SOURCE[0]:=${0}}) | |
else | |
T=${BASH_SOURCE[0]:=${0}} | |
fi | |
D=$(dirname ${T}) | |
#apt-get install libfcgi-dev libfcgi0ldbl libjpeg62-turbo-dbg libmcrypt-dev libssl-dev libc-client2007e libc-client2007e-dev libxml2-dev libbz2-dev libcurl4-openssl-dev libjpeg-dev libpng12-dev libfreetype6-dev libkrb5-dev libpq-dev libxml2-dev libtidy-dev libmemcached-dev imagemagick-dev msgpack-dev |
This file contains 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
<?php | |
namespace App\Providers; | |
use Illuminate\Database\Events\ConnectionEvent; | |
use Illuminate\Database\Events\TransactionBeginning; | |
use Illuminate\Database\Events\TransactionCommitted; | |
use Illuminate\Database\Events\TransactionRolledBack; | |
use Illuminate\Support\Facades\Event; | |
use Illuminate\Support\ServiceProvider; |
This file contains 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
// Copyright 2009 The Go Authors. All rights reserved. | |
// Use of this source code is governed by a BSD-style | |
// license that can be found in the LICENSE file. | |
//go:build ignore | |
// +build ignore | |
// Generate a self-signed X.509 certificate for a TLS server. Outputs to | |
// 'cert.pem' and 'key.pem' and will overwrite existing files. |
This file contains 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
#!/usr/bin/env python | |
#-*- coding:utf-8 -*- | |
import socket | |
import select | |
import Queue | |
#创建socket对象 | |
serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
This file contains 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
<?php | |
// passed in php 7.4 | |
$service_url = 'https://api.push.apple.com/3/device/'; | |
$token = '07cd****3217****6289****94999228d7b45339fbafdf08****8f83****499b'; | |
$headers = array(); | |
$header[] = 'apns-topic:com.xxxxx.xxapp'; // bundle-id | |
$payload = '{"aps":{"alert":"hello","sound":"msg_high.m4a"}}'; |
This file contains 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
<?php | |
// page: https://yuanxuxu.com/2018/11/26/php-snowflake/ | |
class Snowflake | |
{ | |
const EPOCH = 1543223810238; // 起始时间戳,毫秒 | |
const SEQUENCE_BITS = 12; //序号部分12位 | |
const SEQUENCE_MAX = -1 ^ (-1 << self::SEQUENCE_BITS); // 序号最大值 |
This file contains 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
<?php | |
function is_point_in_polygon($point, $pts) { | |
$N = count($pts); | |
$boundOrVertex = true; //如果点位于多边形的顶点或边上,也算做点在多边形内,直接返回true | |
$intersectCount = 0;//cross points count of x | |
$precision = 2e-10; //浮点类型计算时候与0比较时候的容差 | |
$p1 = 0;//neighbour bound vertices | |
$p2 = 0; | |
$p = $point; //测试点 |
This file contains 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
<?php | |
$rand = [20,15,10,6]; | |
$r = 39; | |
function combination($a, $m) { | |
$r = array(); | |
$n = count($a); | |
if ($m <= 0 || $m > $n) { | |
return $r; |
NewerOlder