Compare commits
2 Commits
b866c33c93
...
a541630848
Author | SHA1 | Date |
---|---|---|
Ceda EI | a541630848 | |
Ceda EI | e067323714 |
37
about.md
37
about.md
|
@ -15,38 +15,13 @@ To make a new entry, click "New" (or type 'control + n')
|
||||||
|
|
||||||
## From the Console
|
## From the Console
|
||||||
|
|
||||||
Most of the time I want to show you some text, it's coming from my current
|
[bin-client](git.webionite.com/ceda_ei/bin-client)
|
||||||
console session. We should make it really easy to take code from the console
|
|
||||||
and send it to people.
|
|
||||||
|
|
||||||
`cat something | haste` # https://hastebin.com/1238193
|
Add the following to your bashrc/zshrc
|
||||||
|
```
|
||||||
You can even take this a step further, and cut out the last step of copying the
|
export MKR_BIN='https://bin.webionite.com/'
|
||||||
URL with:
|
export HASTEBIN=1
|
||||||
|
```
|
||||||
* 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,3 +1,4 @@
|
||||||
|
// 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');
|
||||||
|
|
||||||
|
@ -106,14 +107,17 @@ if (config.rateLimits) {
|
||||||
app.use(connect_rate_limit(config.rateLimits));
|
app.use(connect_rate_limit(config.rateLimits));
|
||||||
}
|
}
|
||||||
|
|
||||||
// first look at API calls
|
function raw(request, response) {
|
||||||
app.use(route(function(router) {
|
|
||||||
// get raw documents - support getting with extension
|
|
||||||
router.get('/raw/:id', function(request, response) {
|
|
||||||
var key = request.params.id.split('.')[0];
|
var key = request.params.id.split('.')[0];
|
||||||
var skipExpire = !!config.documents[key];
|
var skipExpire = !!config.documents[key];
|
||||||
return documentHandler.handleRawGet(key, response, skipExpire);
|
return documentHandler.handleRawGet(key, response, skipExpire);
|
||||||
});
|
}
|
||||||
|
|
||||||
|
// first look at API calls
|
||||||
|
app.use(route(function(router) {
|
||||||
|
// get raw documents - support getting with extension
|
||||||
|
router.get('/raw/:id', raw);
|
||||||
|
router.get('/:id/raw', raw);
|
||||||
// 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);
|
||||||
|
@ -137,7 +141,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