Skip to content

Instantly share code, notes, and snippets.

<?php
define('PASSWORD','putyourpasswordhere');
define('DOMAIN','h');
function extend($file_name) {
$extend = pathinfo($file_name);
$extend = strtolower($extend["extension"]);
return $extend;
}
@JaHIY
JaHIY / Grabbs.py
Created March 19, 2012 14:37
Python: Grabbs
#! /usr/bin/env python
# -*- coding: utf-8 -*-
'''
python Grubbs.py 1.25 1.27 1.31 1.40 1.40 0.05 #前面一堆是数据,倒数第二的数是可疑值,最后一位是显著性水平a,可用值为 0.05/0.025/0.01
'''
import math
def solve(*args):
@JaHIY
JaHIY / svalues.py
Created March 21, 2012 08:46
Python: Grubbs, 4d, Q
#! /usr/bin/env python
# -*- coding: utf-8 -*-
'''
1.Grubbs
python svalues.py 1.25 1.27 1.31 1.40 1.40 0.05 'Grubbs'
python svalues.py data(0) data(1) data(2) ... data(n) (n>=2) 可疑值x 显著性水平a(可用值为 0.05/0.025/0.01) 'Grubbs'
2.4d
python svalues.py 1.25 1.27 1.31 1.40 1.40 '4d'
@JaHIY
JaHIY / menu.c
Created April 3, 2012 04:24
C:A big homework of C language lesson
#include<stdio.h>
#include<math.h>
void clearbuffer(void) {
int z;
while ((z = getchar()) != '\n' && z != EOF);
}
long int narcissistic_number(long int x) {
long int a, sum=0, t=x;
@JaHIY
JaHIY / svalues.c
Created April 30, 2012 06:03
C: Grubbs, 4d, Q (rewrite gist:2145652[python] into C Language)
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
/*
1.Grubbs
./svalues 1.25 1.27 1.31 1.40 1.40 0.05 Grubbs
./svalues data(0) data(1) data(2) ... data(n) (n>=2) 可疑值x 显著性水平a(可用值为 0.05/0.025/0.01) Grubbs
@JaHIY
JaHIY / cnbeta.patch
Created May 27, 2012 06:24
Javascript: patch for Nayuki's CnBeta #自古CB出评论 sharing plugin
--- nayukiscnbetacbsharingplugin@httpnayukiinfo.user.js 2012-05-27 14:22:49.774249195 +0800
+++ nayukiscnbetacbsharingplugin@httpnayukiinfo.modified.user.js 2012-05-27 14:17:10.000000000 +0800
@@ -61,8 +61,8 @@
$("dd.re_detail").each(function(){
comment = $(this).text();//获取评论
finale = comment + " ——《" + title + "》 " + window.location.href + " "; //拼合tweet正文的结果
+ finale = $.trim(finale);//除去原评论字段中多余的空格字符
finale = encodeURI(finale);
- finale = finale.substring(15);//除去原评论字段中多余的空格字符
@JaHIY
JaHIY / proxy.pac
Last active September 29, 2020 03:45
Javacript: My Pac File (some code from @ayanamist 's Pac File)
var METHODS = {
PROXY_METHOD:"PROXY 127.0.0.1:8123",
NO_PROXY_METHOD:"DIRECT"
},
rules = [
".akamai.net",
".akamaihd.net",
".appspot.com",
".bitsnoop.com",
".blogspot.com",
@JaHIY
JaHIY / fb-loading.html
Created June 20, 2012 05:15
CSS3:Facebook-style loading
<style>
#facebookG{
}
.facebook_blockG{
background-color:#FFFFFF;
border:1px solid #000000;
float:left;
height:91px;
margin-left:5px;
@JaHIY
JaHIY / base.css
Created June 21, 2012 12:45
CSS:Another HTML5 reset stylesheet which merged with three different html5 reset css
@charset "utf-8";
/*
@名称: base
@功能: 重设浏览器默认样式
This HTML5 reset Stylesheet merged with the following HTML5 reset Stylesheets:
https://github.com/alipay/alice/blob/master/base.css
http://html5doctor.com/html-5-reset-stylesheet/
https://github.com/necolas/normalize.css/blob/master/normalize.css
@JaHIY
JaHIY / play_test.js
Created July 18, 2012 07:26
Javascript:Blibili new-style flash player
javascript:(function(){$("embed[src$='play.swf']").attr("src",function(i,v){return v.replace(/play.swf/,"play_test.swf")});})();