Skip to content

Instantly share code, notes, and snippets.

@lidatui
lidatui / gist:82485f85c24900cec908
Last active August 29, 2015 14:16
解析几何点和直线的关系
Point2D p1 = new Point2D.Double(10,20);
Point2D p2 = new Point2D.Double(100,200);
Rectangle2D rect = new Line2D.Double(p1, p2).getBounds2D();
//一般式直线方程
Double A = p2.getY() - p1.getY();
Double B = p1.getX() - p2.getX();
Double C = p2.getX() * p1.getY() - p1.getX() * p2.getY();
System.out.println(String.format("A=%s, B=%s, C=%s", A, B, C));
@lidatui
lidatui / gist:03a5ae6b09f83b0e676e
Created September 21, 2014 14:53
自定义序号
<style type="text/css">
<!--
ol {
counter-reset: item;
margin-left: 0;
padding-left: 0;
}
li {
display: block;
margin-bottom: .5em;
@lidatui
lidatui / gist:9db01bc37f54fd6ea3e2
Created September 16, 2014 03:02
AngularJS POST parameter
$http({
method : 'POST',
url : 'process.php',
data : $.param($scope.formData), // pass in data as strings
headers : { 'Content-Type': 'application/x-www-form-urlencoded' } // set the headers so angular passing info as form data (not request payload)
})
.success(function(data) {
});
@lidatui
lidatui / gist:8079988
Last active January 1, 2016 02:29
Make position:fixed work in IE6
http://subtlegradient.com/articles/2009/07/29/css_position_fixed_for_ie6.html
/*Make position:fixed work in IE6!*/
.fixed-top /* position fixed Top */{position:fixed;bottom:auto;top:0;}
.fixed-bottom /* position fixed Bottom */{position:fixed;bottom:0;top:auto;}
.fixed-left /* position fixed Left */{position:fixed;right:auto;left:0;}
.fixed-right /* position fixed right */{position:fixed;right:0;left:auto;}
* html,* html body /* IE6 Fixed Position Jitter Fix */{background-image:url(about:blank);background-attachment:fixed;}
@lidatui
lidatui / gist:7972033
Created December 15, 2013 11:44
雷神
Delta 119=CE Tau 60 II b (威胁等级 4)
X: 66262101
Y: 69774966
往左走大概2分钟的位置,会有一个往下走的洞,可以看到个科技箱,内有机器人科技!
@lidatui
lidatui / gist:7971544
Last active December 31, 2015 10:09
starbound
指定傳送晶片:
瞬間移動晶片:
高速移動晶片:
B星盤(X -58270185 Y 63943278 )
Beta 60 Leo 271 VI (Lv:18)向左
火箭跳躍晶片:
R星盤(X 73225611 Y 70649384 )
@lidatui
lidatui / gist:7244682
Created October 31, 2013 05:22
jQuery使用UTF-8发送数据
$.ajaxSetup({
contentType: "application/x-www-form-urlencoded; charset=utf-8"
});
@lidatui
lidatui / gist:6709851
Created September 26, 2013 04:25
修改git的用户名和邮箱
git config --global user.name "Your Name"
git config --global user.email [email protected]
全局的通过vim ~/.gitconfig来查看
git config user.name "Your Name"
git config user.email [email protected]
局部的通过当前路径下的 .git/config文件来查看
也可以修改提交的用户名和Email:
git commit --amend --author='Your Name <[email protected]>'
@lidatui
lidatui / gist:6438187
Last active December 22, 2015 07:28
nodejs express http https
var fs = require('fs');
var http = require('http');
var https = require('https');
var privateKey = fs.readFileSync('sslcert/server.key', 'utf8');
var certificate = fs.readFileSync('sslcert/server.crt', 'utf8');
var credentials = {key: privateKey, cert: certificate};
var express = require('express');
var app = express();
var httpServer;
@lidatui
lidatui / gist:5906315
Created July 2, 2013 02:11
建立远程仓库
$ git remote add origin https://git.oschina.net/miemiedev/fund.git
$ git push -u origin master