Demonstrates use of event capture phase (as opposed to bubble phase, used by jQuery's bind) to prevent default trello click events if ALT key is depressed.
Visit http://bl.ocks.org/dergachev/5571933 to install this bookmarklet.
// This event is fired each time the user updates the text in the omnibox, | |
// as long as the extension's keyword mode is still active. | |
chrome.omnibox.onInputChanged.addListener( | |
function(text, suggest) { | |
console.log('inputChanged: ' + text); | |
suggest([ | |
{content: text + " one", description: "the first one"}, | |
{content: text + " number two", description: "the second entry"} | |
]); | |
}); |
Demonstrates use of event capture phase (as opposed to bubble phase, used by jQuery's bind) to prevent default trello click events if ALT key is depressed.
Visit http://bl.ocks.org/dergachev/5571933 to install this bookmarklet.
<?xml version="1.0" encoding="UTF-8" ?> | |
<schema name="example" version="1.2"> | |
<types> | |
<fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/> | |
<fieldType name="pdate" class="solr.DateField" sortMissingLast="true" omitNorms="true"/> | |
<fieldType name="text" class="solr.TextField" positionIncrementGap="100"> | |
<analyzer type="index"> | |
<tokenizer class="solr.WhitespaceTokenizerFactory"/> | |
<filter class="solr.StopFilterFactory" | |
ignoreCase="true" |
My notes from setting up VNC access from OS X 10.8 (client) to Ubuntu 10.04 lucid (server)
First, install x11vnc:
sudo apt-get install x11vnc
Then run it as follows:
# Place this file in the same directory as `Vagrantfile' | |
# then simply require "vagrant-snapshot.rb" at the top of Vagrantfile. | |
require 'optparse' | |
Vagrant.commands.register(:snap) { Snap::Commands } | |
# Provide rake-like desc() 'inflected' documentation | |
# See http://stackoverflow.com/questions/2948328/access-attributes-methods-comments-programmatically-in-ruby | |
class Module |
Bookmarklet that fixes rot13 encoding on Slashdot on April 1, 2013.
To install, visit http://bl.ocks.org/d/5285534
#! /bin/env bash | |
cat $1 | ruby -pe 'puts " "*20 if $_.match("^```$")' \ | |
| pandoc -f markdown -t textile \ | |
| ruby -r CGI -n -e 'print CGI.unescapeHTML($_);' \ | |
| ruby -ne 'puts $_ unless $_.match(" "*20)' \ | |
| pbcopy | |
# without spaces, pandoc outputs "bc." for code blocks, which isn't accepted to redmine | |
# it also annoyingly HTML escapes its pre- block contents |
BOF followup to https://gist.github.com/4698240
jonathan pugh steve merrill david king dkingofpa alex dergachev
and other cool people
Vagrant tutorial