Skip to content

Instantly share code, notes, and snippets.

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

JellyBool JellyBool

🏠
Working from home
View GitHub Profile
@JellyBool
JellyBool / sendCloud.php
Last active April 28, 2022 01:11
SendCloud Email Version_2
<?php
namespace App\Mailer;
/**
* Class QQMailer
* @package App\Mailer
*/
class Mailer {
@JellyBool
JellyBool / .zshrc
Created July 17, 2016 08:40
git log pretty
alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
@JellyBool
JellyBool / alipay_return_url_checker.php
Last active August 1, 2019 07:28
alipay payment gateway verify
<?php
protected function isFromAlipay($notifyId)
{
$url = 'https://mapi.alipay.com/gateway.do?service=notify_verify&partner=' . trim(env('ALIPAY_PID')) . '&notify_id=' . $notifyId;
$response = $this->httpGet($url);
return (bool) preg_match("/true$/i",$response);
}
@JellyBool
JellyBool / pingxx_verify.php
Last active August 1, 2019 07:28
Pingxx verify , depence on pingxx package
<?php
// Ping++ 的数据可以这样获取
// $rawData = file_get_contents('php://input');
// 判断是否返回 1 ,最后记得返回 http_response_code(200);
protected function verifyPing($rawData) {
$headers = \Pingpp\Util\Util::getRequestHeaders();//这是Ping++的package提供的
$signature = isset($headers['X-Pingplusplus-Signature']) ? $headers['X-Pingplusplus-Signature'] : NULL;
$publicKeyContents = file_get_contents(public_path(). '/rsa_public_key.pem');//注意这里面的文件路径相对应
@JellyBool
JellyBool / number.js
Last active August 1, 2019 07:27
comes from some day
function makeNum(number, func) {
if (func == null) { return number; }
else { return func(number); }
}
function two(func) {
return makeNum(2, func);
}
function three(func) {
return makeNum(3, func);
}
@JellyBool
JellyBool / laravel-worker.conf
Created July 3, 2016 08:03
laravel-worker.conf
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /home/vagrant/Code/queue-series/artisan queue:listen --tries=3
autostart=true
autorestart=true
numprocs=8
redirect_stderr=true
stdout_logfile=/home/vagrant/Code/queue-series/storage/logs/worker.log
@JellyBool
JellyBool / score.php
Last active August 1, 2019 07:26
What is your github score
<?php
$eventTypes = [];
$score = 0;
foreach ($events as $event) {
$eventTypes[] = $event['type'];
}
foreach ($eventTypes as $eventType) {
switch ($eventType){
case 'PushEvent':
@JellyBool
JellyBool / webpack.config.js
Created October 29, 2016 08:23
webpack lesson
var debug = process.env.NODE_ENV !== "production";
var webpack = require('webpack');
module.exports = {
context: __dirname,
devtool: debug ? "inline-sourcemap" : null,
entry: "./js/entry.js",
output: {
path: __dirname + "/js",
filename: "app.min.js"
.panel-body.content img {
width: 100%;
}
a.topic {
background: #eff6fa;
padding: 1px 10px 0;
border-radius: 30px;
text-decoration: none;
margin: 0 5px 5px 0;
@JellyBool
JellyBool / phone.php
Created July 31, 2017 14:25
手机号正则
<?php
public function passes($attribute, $value)
{
return preg_match('/^(13[0-9]|14[579]|15[0-3,5-9]|17[0135678]|18[0-9])\\d{8}$/',$value);
}