Skip to content

Instantly share code, notes, and snippets.

View zhaoxiaobao's full-sized avatar
🤒
Out sick

zhaoyuan zhaoxiaobao

🤒
Out sick
View GitHub Profile
@zhaoxiaobao
zhaoxiaobao / cors.js
Created September 21, 2022 14:26 — forked from balupton/cors.js
Acheiving CORS via a Node HTTP Server
// Create our server
var server;
server = http.createServer(function(req,res){
// Set CORS headers
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Access-Control-Request-Method', '*');
res.setHeader('Access-Control-Allow-Methods', 'OPTIONS, GET');
res.setHeader('Access-Control-Allow-Headers', '*');
if ( req.method === 'OPTIONS' ) {
res.writeHead(200);
This file has been truncated, but you can view the full file.
127.0.0.1 ad-maven.com
127.0.0.1 ad.azure.com
127.0.0.1 ads.taboola.com
127.0.0.1 tracker.eu.org
127.0.0.1 stats.uptimerobot.com
127.0.0.1 center-h5api.m.taobao.com
127.0.0.1 app.adjust.com
127.0.0.1 uland.taobao.com
127.0.0.1 advertisement.taobao.com
127.0.0.1 baozhang.baidu.com
{
"configs" : [
{
"server" : "119.28.188.189",
"server_port" : 8989,
"password" : "ashaeSCd%",
"method" : "aes-256-cfb",
"remarks" : "tencent-hk"}
,
{
@zhaoxiaobao
zhaoxiaobao / sql
Created January 25, 2018 09:40
sql 几条sql查询出此结果
表1 group表
id group_name
1 g1
2 g2
表2 list表
id name group_id
1 n1 1
2 n2 1
3 n3 2
@zhaoxiaobao
zhaoxiaobao / nginx-proxy_pass
Created December 27, 2017 07:40
nginx-proxy_pass
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /usr/share/nginx/html;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
{
"id": "8",
"order_no": "B627456135092948",
"company_id": "1",
"user_id": "3",
"vin": "",
"brand_id": "9",
"series_id": "2488",
"model_id": "30282",
"vehicle_province_id": "24",
@import "mixins.less";
// Prefix
@che300-prefix : che300;
@che300-prefix-css :~"@{che300-prefix}-css";
@che300-prefix-btn :~"@{che300-prefix}-btn";
@che300-prefix-tag :~"@{che300-prefix}-tag";
@che300-prefix-pricing :~"@{che300-prefix}-pricing";
// Color
@primary-color : #f6f7fb;
@zhaoxiaobao
zhaoxiaobao / index.html
Created October 11, 2016 03:22 — forked from k4ml/index.html
PHP SSE Demo
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<script>
var source = new EventSource('updates.php');
source.onmessage = function(e) {
var updates;
@zhaoxiaobao
zhaoxiaobao / ff_ffplay_def.h
Created August 29, 2016 04:51
ff_ffplay_def.h
/*
* Copyright (c) 2003 Fabrice Bellard
* Copyright (c) 2013-2015 Zhang Rui <bbcallen@gmail.com>
*
* This file is part of ijkPlayer.
*
* ijkPlayer is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
@zhaoxiaobao
zhaoxiaobao / gist:6322b0fb2fdc8467100284df4bf31253
Created August 23, 2016 08:14
LFLiveKit中VideoToolbox进行硬编代码
static void VideoCompressonOutputCallback(void *VTref, void *VTFrameRef, OSStatus status, VTEncodeInfoFlags infoFlags, CMSampleBufferRef sampleBuffer)
{
if(!sampleBuffer) return;
CFArrayRef array = CMSampleBufferGetSampleAttachmentsArray(sampleBuffer, true);
if(!array) return;
CFDictionaryRef dic = (CFDictionaryRef)CFArrayGetValueAtIndex(array, 0);
if(!dic) return;
BOOL keyframe = !CFDictionaryContainsKey(dic, kCMSampleAttachmentKey_NotSync);
uint64_t timeStamp = [((__bridge_transfer NSNumber*)VTFrameRef) longLongValue];