Compare commits
No commits in common. "a541630848adc8d1a4a746de51769f2f3fa780bc" and "b866c33c9306142d805a2a91ec8503d185636ade" have entirely different histories.
a541630848
...
b866c33c93
37
about.md
37
about.md
|
@ -15,13 +15,38 @@ To make a new entry, click "New" (or type 'control + n')
|
||||||
|
|
||||||
## From the Console
|
## From the Console
|
||||||
|
|
||||||
[bin-client](git.webionite.com/ceda_ei/bin-client)
|
Most of the time I want to show you some text, it's coming from my current
|
||||||
|
console session. We should make it really easy to take code from the console
|
||||||
|
and send it to people.
|
||||||
|
|
||||||
Add the following to your bashrc/zshrc
|
`cat something | haste` # https://hastebin.com/1238193
|
||||||
```
|
|
||||||
export MKR_BIN='https://bin.webionite.com/'
|
You can even take this a step further, and cut out the last step of copying the
|
||||||
export HASTEBIN=1
|
URL with:
|
||||||
```
|
|
||||||
|
* osx: `cat something | haste | pbcopy`
|
||||||
|
* linux: `cat something | haste | xsel`
|
||||||
|
* windows: check out [WinHaste](https://github.com/ajryan/WinHaste)
|
||||||
|
|
||||||
|
After running that, the STDOUT output of `cat something` will show up at a URL
|
||||||
|
which has been conveniently copied to your clipboard.
|
||||||
|
|
||||||
|
That's all there is to that, and you can install it with `gem install haste`
|
||||||
|
right now.
|
||||||
|
* osx: you will need to have an up to date version of Xcode
|
||||||
|
* linux: you will need to have rubygems and ruby-devel installed
|
||||||
|
|
||||||
|
## Duration
|
||||||
|
|
||||||
|
Pastes will stay for 30 days from their last view. They may be removed earlier
|
||||||
|
and without notice.
|
||||||
|
|
||||||
|
## Privacy
|
||||||
|
|
||||||
|
While the contents of hastebin.com are not directly crawled by any search robot
|
||||||
|
that obeys "robots.txt", there should be no great expectation of privacy. Post
|
||||||
|
things at your own risk. Not responsible for any loss of data or removed
|
||||||
|
pastes.
|
||||||
|
|
||||||
## Open Source
|
## Open Source
|
||||||
|
|
||||||
|
|
16
server.js
16
server.js
|
@ -1,4 +1,3 @@
|
||||||
// vim: set ts=2 sw=2 sts=2 et:
|
|
||||||
var http = require('http');
|
var http = require('http');
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
|
|
||||||
|
@ -107,17 +106,14 @@ if (config.rateLimits) {
|
||||||
app.use(connect_rate_limit(config.rateLimits));
|
app.use(connect_rate_limit(config.rateLimits));
|
||||||
}
|
}
|
||||||
|
|
||||||
function raw(request, response) {
|
|
||||||
var key = request.params.id.split('.')[0];
|
|
||||||
var skipExpire = !!config.documents[key];
|
|
||||||
return documentHandler.handleRawGet(key, response, skipExpire);
|
|
||||||
}
|
|
||||||
|
|
||||||
// first look at API calls
|
// first look at API calls
|
||||||
app.use(route(function(router) {
|
app.use(route(function(router) {
|
||||||
// get raw documents - support getting with extension
|
// get raw documents - support getting with extension
|
||||||
router.get('/raw/:id', raw);
|
router.get('/raw/:id', function(request, response) {
|
||||||
router.get('/:id/raw', raw);
|
var key = request.params.id.split('.')[0];
|
||||||
|
var skipExpire = !!config.documents[key];
|
||||||
|
return documentHandler.handleRawGet(key, response, skipExpire);
|
||||||
|
});
|
||||||
// add documents
|
// add documents
|
||||||
router.post('/documents', function(request, response) {
|
router.post('/documents', function(request, response) {
|
||||||
return documentHandler.handlePost(request, response);
|
return documentHandler.handlePost(request, response);
|
||||||
|
@ -141,7 +137,7 @@ app.use(connect_st({
|
||||||
// Then we can loop back - and everything else should be a token,
|
// Then we can loop back - and everything else should be a token,
|
||||||
// so route it back to /
|
// so route it back to /
|
||||||
app.use(route(function(router) {
|
app.use(route(function(router) {
|
||||||
router.get('/:id', function(request, _response, next) {
|
router.get('/:id', function(request, response, next) {
|
||||||
request.sturl = '/';
|
request.sturl = '/';
|
||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue