Skip to content

Instantly share code, notes, and snippets.

View DrayChou's full-sized avatar
😸

Dray DrayChou

😸
View GitHub Profile
@yulanggong
yulanggong / calender.md
Created June 13, 2014 05:35
日历标准格式研究

日历标准格式研究

日历的导入导出

格式

现在通用的日历格式是 iCalendar,通常扩展名是 .ics

BEGIN:VCALENDAR #日历开始
@aa65535
aa65535 / aria2.bat
Last active February 7, 2024 05:41
Aria2的配置文件 & 启动脚本
:: 启动后需要保留窗口, 关闭窗口则结束进程
aria2c --conf-path=aria2.conf -D
@caok
caok / gist:8877936
Created February 8, 2014 07:22
如何在Node.js中获取本机IP地址
//获取本地IP地址
var os = require('os');
var IPv4,hostName;
hostName=os.hostname();
for(var i=0;i<os.networkInterfaces().eth0.length;i++){
if(os.networkInterfaces().eth0[i].family=='IPv4'){
IPv4=os.networkInterfaces().eth0[i].address;
}
}
console.log('----------local IP: '+IPv4);
@HikoQiu
HikoQiu / download_http_range.php
Last active April 6, 2017 06:41
PHP断点下载
// 通过 HTTP_RANGE
// VERSION 1 断点下载
range = 0;
dheader('Accept-Ranges: bytes');
if(!empty(_SERVER['HTTP_RANGE'])) {
list(range) = explode('-',(str_replace('bytes=', '', _SERVER['HTTP_RANGE'])));
rangesize = (filesize - range) > 0 ? (filesize - range) : 0;
dheader('Content-Length: '.rangesize);
@jmervine
jmervine / 1_http_hello.go
Last active November 22, 2019 13:16
Golang - Hello PATH HTTP Server Example
package main
import (
"fmt"
"log"
"net/http"
)
func Log(handler http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
@clowwindy
clowwindy / ssl.md
Last active May 11, 2024 03:22
为什么不应该用 SSL 翻墙

SSL 设计目标:

  1. 防内容篡改
  2. 防冒充服务器身份
  3. 加密通信内容

而翻墙的目标:

  1. 不被检测出客户端在访问什么网站
  2. 不被检测出服务器在提供翻墙服务
@minikomi
minikomi / editor.html
Last active November 11, 2021 10:16
my editor
data:text/html,
<style type="text/css">
#e {
position:absolute;
top:0;
right:0;
bottom:0;
left:0;
font-size:16px;
}
@codler
codler / gist:3906826
Created October 17, 2012 17:18
Support HTTP Header Range, mp4, php.php/mp4.mp4
<?php
# Nginx don't have PATH_INFO
if (!isset($_SERVER['PATH_INFO'])) {
$_SERVER['PATH_INFO'] = substr($_SERVER["ORIG_SCRIPT_FILENAME"], strlen($_SERVER["SCRIPT_FILENAME"]));
}
$request = substr($_SERVER['PATH_INFO'], 1);
$file = $request;
$fp = @fopen($file, 'rb');
@zolunx10
zolunx10 / .gitignore
Last active December 24, 2023 15:14
Rime用颜文字(及符号)字典. 个人都绑定到v键开头了, 请下载kaomoji*并酌情修改字典文件.dict.yaml; 另如果要在当前输入法中直接嵌入, 请参考luna_pinyin_simp.custom.yaml前半段修改您的输入法设置.
*
!.gitignore
!alternative.yaml
!*.custom.yaml
!kaomoji.*.yaml
@border
border / sina.go
Created September 3, 2012 07:06
goauth2 for sina weibo
// Copyright 2012 Jiang Bian (borderj@gmail.com). All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Email: borderj@gmail.com
// Blog: http://wifihack.net/
// Sina WeiBo oauth2 Login, Base on goauth2 lib
package main