I hereby claim:
- I am tomalak on github.
- I am tomalak (https://keybase.io/tomalak) on keybase.
- I have a public key whose fingerprint is 131F C1F5 BEFD 5B22 7E26 24F1 134E 854E 117D 1A21
To claim this, I am signing this object:
set fso = CreateObject("Scripting.FilesystemObject") | |
set shell = CreateObject("Wscript.Shell") | |
set args = wscript.Arguments | |
set re = New RegExp | |
set TodoList = CreateObject("Scripting.Dictionary") | |
appName = "File Rename Tool" | |
myname = wscript.scriptfullname | |
mypath = left(myname, instrrev(myname, "\") -1) | |
regkey = "HKCU\Software\vbsReplaceTool\" |
// Details: StackOverflow (http://stackoverflow.com/a/614397/18771) | |
// License: cc-by-sa (http://creativecommons.org/licenses/by-sa/3.0/) | |
// Extends: jQuery Tablesorter 2.0+ (http://tablesorter.com) | |
// ------------------------------------------------------------------- | |
// file encoding must be UTF-8! | |
function getTextExtractor() | |
{ | |
return (function() { | |
var patternLetters = /[öäüÖÄÜáàâéèêúùûóòôÁÀÂÉÈÊÚÙÛÓÒÔß]/g; |
#!/usr/bin/env python | |
import urllib, re | |
from collections import OrderedDict | |
url = 'https://play.google.com/store/devices' | |
data = urllib.urlopen(url).read() | |
matches = re.findall(r'\bNexus \d+', data) | |
devices = OrderedDict.fromkeys(matches).keys() |
/* | |
* enables convenient creation and use of HTML5 datalist inputs | |
* - knockout.js 2.3.0+ | |
* - http://stackoverflow.com/a/19867498/18771 | |
* - http://jsfiddle.net/GJ4h4/3/ | |
*/ | |
ko.bindingHandlers.datalist = (function () { | |
function getVal(rawItem, prop) { | |
var item = ko.unwrap(rawItem); | |
return item && prop ? ko.unwrap(item[prop]) : item; |
/* jquery.custom-selectors.count.js | |
* | |
* custom selector for finding elements that have a certain child/descendant count | |
* | |
* Usage: $("td:count(div, 3)") - all <td> that have 3 <div> as direct children | |
* $("td:countAll(div, 3)") - all <td> that have 3 <div> as descendants | |
*/ | |
jQuery.extend(jQuery.expr[':'], ( | |
function () { |
/* Released under the MIT License in 2014. http://opensource.org/licenses/mit-license */ | |
function isNodeList(nodes) { | |
var stringRepr = Object.prototype.toString.call(nodes); | |
return typeof nodes === 'object' && | |
/^\[object (HTMLCollection|NodeList|Object)\]$/.test(stringRepr) && | |
nodes.hasOwnProperty('length') && | |
(nodes.length === 0 || (typeof nodes[0] === "object" && nodes[0].nodeType > 0)); | |
} |
public class IndexOfWord { | |
public static void main(String[] args) { | |
String input = "There are longer strings than this not very long one."; | |
String search = "long"; | |
// using a StringBuilder enables passing a string as | |
// a function argument without creating a copy of it | |
int index = indexOfWord(new StringBuilder(input), search); | |
if (index > -1) { |
ko.extenders.undoBuffer = function (target, maxUndo) { | |
var undoBuffer = ko.observableArray([]), undoing; | |
target.canUndo = ko.computed(function () { | |
return undoBuffer().length > 0; | |
}); | |
target.undo = function () { | |
if (!target.canUndo()) return; | |
undoing = true; | |
target(undoBuffer.pop()); |
/* Utility functions to create a nested, multilevel grouped, ordered | |
* structure out of a flat array of uniform objects. | |
* | |
* usage: result = applyStructure(items, structure); | |
* | |
* structure is an object of the form: | |
* { | |
* group: "propertyName1" | |
* order: ["propertyName1", "propertyName2 DESC", ...] | |
* next: { |
I hereby claim:
To claim this, I am signing this object: