This file contains 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
//$(document).bind({ cut: function () {}, copy: function () {}, paste: function () {} }); | |
window.logCut = function () { | |
$(document).on("cut", function (e) { | |
var selectedText = (window.getSelection ? window.getSelection() : document.getSelection ? document.getSelection() : document.selection.createRange().text); | |
if (!selectedText || selectedText == "") { | |
if (document.activeElement.selectionStart) { | |
selectedText = document.activeElement.value.substring(document.activeElement.selectionStart.document.activeElement.selectionEnd); | |
} | |
} |
This file contains 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
function getTab(sender, count) { | |
chrome.tabs.query({ | |
windowId: sender.tab.windowId | |
}, function (tabs) { | |
var newTabId = tabs[(((count + sender.tab.index) % tabs.length) + tabs.length) % tabs.length].id; | |
return chrome.tabs.update(newTabId, { | |
active: true | |
}); |
This file contains 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
BM25.stopwods = ['a', 'about', 'above', 'across', 'after', 'afterwards', 'again', 'against', 'all', 'almost', 'alone', 'along', 'already', 'also', 'although', 'always', 'am', 'among', 'amongst', 'amoungst', 'amount', 'an', 'and', 'another', 'any', 'anyhow', 'anyone', 'anything', 'anyway', 'anywhere', 'are', 'around', 'as', 'at', 'back', 'be', 'became', 'because', 'become', 'becomes', 'becoming', 'been', 'before', 'beforehand', 'behind', 'being', 'below', 'beside', 'besides', 'between', 'beyond', 'bill', 'both', 'bottom', 'but', 'by', 'call', 'can', 'cannot', 'cant', 'co', 'computer', 'con', 'could', 'couldnt', 'cry', 'de', 'describe', 'detail', 'do', 'done', 'down', 'due', 'during', 'each', 'eg', 'eight', 'either', 'eleven', 'else', 'elsewhere', 'empty', 'enough', 'etc', 'even', 'ever', 'every', 'everyone', 'everything', 'everywhere', 'except', 'few', 'fifteen', 'fify', 'fill', 'find', 'fire', 'first', 'five', 'for', 'former', 'formerly', 'forty', 'found', 'four', 'from', 'front', 'full', 'further', 'get', 'g |
This file contains 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
"use strict" | |
/* | |
const fs = require('fs') | |
const https = require("https") | |
const url = require("url") | |
const path = require('path') | |
const args = process.argv.slice(2) | |
*/ |
This file contains 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
window.addEventListener('wheel', function(e){ | |
wDelta = e.wheelDelta < 0 | |
? this.dispatchEvent(new Event('wheeldown')) | |
: this.dispatchEvent(new Event('wheelup')) | |
}) | |
$(function() { | |
$(window).on("wheeldown", function(e) { | |
console.log(e) | |
// window.scrollBy(0, window.innerHeight) |
This file contains 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
(function (a) { | |
a.fn.replaceTag = function (f) { | |
var g = [], h = this.length; | |
while (h--) { | |
var k = document.createElement(f), b = this[h], d = b.attributes; | |
for (var c = d.length - 1; c >= 0; c--) { | |
var j = d[c]; | |
k.setAttribute(j.name, j.value) | |
} | |
k.innerHTML = b.innerHTML; |
This file contains 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
.su-candidate-button { | |
-webkit-transition: opacity 1; | |
-moz-transition: opacity 1; | |
-o-transition: opacity 1; | |
transition: opacity 1; | |
-webkit-transition-delay: 0; | |
-moz-transition-delay: 0; | |
-o-transition-delay: 0; | |
transition-delay: 0; | |
opacity: 0; |
This file contains 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
https://stackoverflow.com/questions/14777593/android-textwatcher-saving-batches-of-similar-changes-for-undo-redo | |
public class UndoRedoHelper { | |
private static final String TAG = UndoRedoHelper.class.getCanonicalName(); | |
private boolean mIsUndoOrRedo = false; | |
private EditHistory mEditHistory; | |
private EditTextChangeListener mChangeListener; |
This file contains 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
<html> | |
<body> | |
<p>If the language you speak is not on the list, you can include it in the URL</p> | |
<select><script> | |
var option = decodeURIComponent(document.location.hash.substring(1)); | |
document.write("<OPTION value=1>English</OPTION>"); | |
document.write("<OPTION value=2>French</OPTION>"); | |
document.write("<OPTION value=3>"+option+"</OPTION>"); | |
This file contains 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
<Keyboard xmlns:android="http://schemas.android.com/apk/res/android" | |
android:keyWidth="10%p" | |
android:keyHeight="7%p" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content"> | |
<!-- <Row></Row> --> | |
<Row android:keyWidth="9.09%p"> | |
<Key android:codes="-25" android:keyIcon="@drawable/ic_double_pointer_left" /> | |
<Key android:codes="-26" android:keyIcon="@drawable/ic_double_pointer_right" /> | |
<Key android:codes="-108" android:keyIcon="@drawable/ic_arrow_left" android:isRepeatable="true" /> |
NewerOlder