https://github.com/mpyw/my-bookmarklet-collection
https://github.com/mpyw/my-bookmarklet-collection
bookmarklets
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mpyw/my-bookmarklet-collection
- Owner: mpyw
- License: unlicense
- Created: 2016-10-24T12:04:10.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2021-02-25T03:36:53.000Z (over 4 years ago)
- Last Synced: 2025-03-06T03:02:14.670Z (7 months ago)
- Topics: bookmarklets
- Homepage:
- Size: 5.86 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# my-bookmarklet-collection
## Social Service
- Open a window for tweeting like "Tweet Button"
```js
javascript:!function(){var a=encodeURIComponent(document.title),b=encodeURIComponent(location.href);open('https://twitter.com/intent/tweet?text='+a+'&url='+b,'_blank','width=550,height=400,scrollbars=1')}();
```### Hatena Bookmark (for Japanese)
- Open a window for adding a new bookmark
```js
javascript:open('http://b.hatena.ne.jp/add?mode=confirm&title='+encodeURIComponent(document.title)+'&url='+encodeURIComponent(location.href),'_blank','width=550,height=400,scrollbars=1');
```## Clipboard Manipulation
### Copy title and URL of the current page
- General
```js
javascript:!function(a){var c=a.body,e=a.createElement('input'),f=a.title+' '+location.href;e.type='text',e.value=f,c.appendChild(e),e.select(),a.execCommand('copy'),c.removeChild(e)}(document);
```- Markdown
```js
javascript:!function(a){var c=a.body,e=a.createElement('input'),f='['+a.title+']('+location.href+')';e.type='text',e.value=f,c.appendChild(e),e.select(),a.execCommand('copy'),c.removeChild(e)}(document);
```- BibTeX
```js
javascript:!function(a){var c=a.body,e=a.createElement('input'),f='\\bibitem{} '+a.title+'\\\\ \\url{'+location.href+'}';e.type='text',e.value=f,c.appendChild(e),e.select(),a.execCommand('copy'),c.removeChild(e)}(document);
```## Adjust Tab Width (for `*.go` and `Makefile`)
- To 4 spaces
```js
javascript:!function(a){var b=a.createElement('style');b.innerHTML='*{tab-size:4;}';a.head.appendChild(b);}(document);
```- To 2 spaces
```js
javascript:!function(a){var b=a.createElement('style');b.innerHTML='*{tab-size:2;}';a.head.appendChild(b);}(document);
```