Справочник переехал: https://github.com/hflabs/city
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Usage: | |
| // var x = document.querySelector('[contenteditable]'); | |
| // var caretPosition = getSelectionDirection(x) !== 'forward' ? getSelectionStart(x) : getSelectionEnd(x); | |
| // setSelectionRange(x, caretPosition + 1, caretPosition + 1); | |
| // var value = getValue(x); | |
| // it will not work with "<img /><img />" and, perhaps, in many other cases. | |
| function isAfter(container, offset, node) { | |
| var c = node; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name MosMetroV2.js | |
| // @description This script skips annoying quizes and full screen ads on https://auth.wi-fi.ru | |
| // @author Dmitry Karikh <mosmetro@thedrhax.pw> (https://github.com/mosmetro-android) | |
| // @version 2 | |
| // @grant none | |
| // @include *://auth.wi-fi.ru/auth* | |
| // ==/UserScript== | |
| (function () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @file get/set caret position and insert text | |
| * @author islishude | |
| * @license MIT | |
| */ | |
| export class Caret { | |
| /** | |
| * get/set caret position | |
| * @param {HTMLColletion} target | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # Save this script as /usr/local/bin/notify-send and make sure to chmod +x! | |
| # NOTE: This has not been extensively tested, though it does work with | |
| # XChat. Let me know if it works with others! | |
| # Make all notify-send calls go away after they've popped up | |
| /usr/bin/notify-send --hint int:transient:1 $@ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //http://www.scottklarr.com/topic/425/how-to-insert-text-into-a-textarea-where-the-cursor-is/ | |
| function insertAtCaret(areaId,text) { | |
| var txtarea = document.getElementById(areaId); | |
| var scrollPos = txtarea.scrollTop; | |
| var strPos = 0; | |
| var br = ((txtarea.selectionStart || txtarea.selectionStart == '0') ? | |
| "ff" : (document.selection ? "ie" : false ) ); | |
| if (br == "ie") { | |
| txtarea.focus(); | |
| var range = document.selection.createRange(); |