Skip to content

Instantly share code, notes, and snippets.

wakasann wakasann

Block or report user

Report or block wakasann

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View batch_add_all_datetimecolumn
drop procedure if exists add_all_timestamp;
CREATE PROCEDURE add_all_timestamp()
BEGIN
DECLARE tableName varchar(30) default '';
DECLARE allAddr varchar(40) default '';
DECLARE tableSchemaName varchar(30) default 'test';
DECLARE done INT DEFAULT 0;
DECLARE curl CURSOR FOR select table_name from information_schema.tables where table_schema=tableSchemaName;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
OPEN curl;
@wakasann
wakasann / laravel_admin_helpers.php
Created Jan 7, 2019
try run laravel admin ^1.6 in subfolder
View laravel_admin_helpers.php
<?php
// var_dump(function_exists('admin_url'));
if (!function_exists('admin_url')) {
/**
* Get admin url.
*
* @param string $path
* @param mixed $parameters
* @param bool $secure
*
@wakasann
wakasann / functions.php
Created Dec 25, 2018 — forked from lmartins/functions.php
By default WooCommerce redirects the user to the My Account page after a successful login. You may change this and use a custom URL based on the user role, like the Dashboard for admins and My Account page for customers. To do this, add this code at the end of the file functions.php located in wp-content/themes/your-theme-name/ https://support.w…
View functions.php
<?php
/**
* Redirect users to custom URL based on their role after login
*
* @param string $redirect
* @param object $user
* @return string
*/
function wc_custom_user_redirect( $redirect, $user ) {
// Get the first of all the roles assigned to the user
@wakasann
wakasann / lopencv431.cpp
Created Jun 20, 2018
学习opencv3变成第4章
View lopencv431.cpp
#include <opencv2/opencv.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
using namespace std;
using namespace cv;
#define WINDOW_WIDTH 600 //定义窗口大小的宏
#define WINDOW_NAME1 "【绘制图1】" // 为窗口标题定义的宏
@wakasann
wakasann / lopencv33.cpp
Last active Jun 19, 2018
鼠标点击开始绘制,弹起之后停止绘制
View lopencv33.cpp
#include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
#define WINDOW_NAME "【程序窗口】"
void on_MouseHandle(int event, int x, int y, int flags, void* param);
void DrawRectangle(cv::Mat& img,cv::Rect box);
void ShowHelpText();
@wakasann
wakasann / lopencv16.cpp
Created Jun 19, 2018
opencv播放视频
View lopencv16.cpp
#include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
int main()
{
//打开视频文件
VideoCapture capture(0); //"1.mp4"
@wakasann
wakasann / lcv321.cpp
Created Jun 19, 2018
线性混合示例
View lcv321.cpp
#include <opencv2./opencv.hpp>
#include "opencv2/highgui/highgui.hpp"
using namespace std;
using namespace cv;
#define WINDOW_NAME "【线性混合示例】" //为窗口标题定义的宏
const int g_nMaxAlphaValue = 100; //Alpha 值的最大值
int g_nAlphaValueSlider; //滑动条对应的变量
@wakasann
wakasann / phpconnectmqttserver.php
Created Jun 8, 2018
use php-amqplib connect to mqttserver
View phpconnectmqttserver.php
<?php
//php connection to mqtt server(rabbitmq)
//use https://packagist.org/packages/php-amqplib/php-amqplib
define('AMQP_DEBUG', true);
require_once __DIR__.'/vendor/autoload.php';
use PhpAmqpLib\Connection\AMQPStreamConnection;
use PhpAmqpLib\Message\AMQPMessage;
$exchange = 'fanout2';
$queue = 'test';
View phppaginationforarray.php
<?php
function p($array){
echo "<pre>";
print_r($array);
echo "</pre>";
}
$array = array();
for($i = 0;$i < 5;$i++){
View readlogfileeachline.php
<?php
//read log file each line,i only need get url line,so use strpos method
// my log file text is:
// /test/index.php //url
// 2017-11-19 00:00;:00 // datetime
// <pre>Array // echo "<pre>";print_r(array());echo "</pre>";
// (
// )
// </pre>
You can’t perform that action at this time.