Skip to content

Instantly share code, notes, and snippets.

View boatgm's full-sized avatar
🤒
Out sick

boatgm boatgm

🤒
Out sick
View GitHub Profile
<?php
//获取域名或主机地址
echo $_SERVER['HTTP_HOST']."<br />";
//获取网页地址
echo $_SERVER['PHP_SELF']."<br />";
//获取网址参数
echo $_SERVER["QUERY_STRING"]."<br />";
//获取用户代理
echo $_SERVER['HTTP_REFERER']."<br />";
//获取完整的url
@boatgm
boatgm / How to use Backbone.js.md
Created October 26, 2016 09:54 — forked from nightire/How to use Backbone.js.md
How to use Backbone.js

Simple Starting Point

创建 Model

var Person = Backbone.Model.extend();
import { h32 as xxhash } from 'xxhashjs';
import crypto from 'crypto';
const LN2_SQUARED = Math.LN2 * Math.LN2;
export default class BloomFilter {
constructor(options = {}){
this.init(options);
}
@boatgm
boatgm / gist:4994192
Created February 20, 2013 09:14
图像质量监测的matlib实现。
%说明:本文件为计算两幅视频图象相对于高清晰图象的质量,其中:
%eyechart1.bmp为未处理前质量较差图象,核心区域的截图保存为area_eyechart1.bmp
%eyechart2.bmp为某种算法处理后质量较好图象,核心区域的截图保存为area_eyechart2.bmp
%eyechart3.bmp为高清晰参考图象,核心区域的截图保存为area_eyechart3.bmp
@boatgm
boatgm / api.js
Last active December 13, 2015 22:38
跨域支持
function do_sum(param1, param2, cfunction) {
// send ajax response to server
$.ajax({
type: 'POST',
url: 'http://www.script-tutorials.com/demos/301/api.php',
crossDomain: true,
dataType: 'json',
data: 'action=sum¶m1=' + param1 + '¶m2=' + param2,
success: function(json) {
@boatgm
boatgm / scrapy_test.py
Last active May 16, 2021 11:34
scrapy examples
from scrapy.spider import BaseSpider
class MindhacksSpider(BaseSpider):
domain_name = "mindhacks.cn"
start_urls = ["http://mindhacks.cn/"]
def parse(self, response):
return []
SPIDER = MindhacksSpider()