Skip to content

Instantly share code, notes, and snippets.

View dergachev's full-sized avatar

Alex Dergachev dergachev

View GitHub Profile
@dergachev
dergachev / background.js
Created May 17, 2013 23:14
omnibox-chrome-extension-demo with bookmarklet support; see https://github.com/dergachev/chrome-bookmark-search/issues/1
// 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"}
]);
});
@dergachev
dergachev / _trello-alt-click.bookmarklet.md
Last active December 17, 2015 07:19
trello-alt-click.bookmarklet.js

About

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.

Installation:

Visit http://bl.ocks.org/dergachev/5571933 to install this bookmarklet.

Resources:

@dergachev
dergachev / schema.xml
Last active December 16, 2015 21:20
ajax-solr reuters demo: schema.xml compatible with Solr 1.4
<?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"
@dergachev
dergachev / README.md
Last active December 16, 2015 19:18
VNC forwarding with Ubuntu Lucid

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
@dergachev
dergachev / pandoc2redmine.sh
Created March 6, 2013 18:31
pandoc2redmine.sh - wrapper script on pandoc to fix textile output for Redmine compatibility
#! /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
@dergachev
dergachev / Vagrant-BOF-drupalcampNJ.md
Last active December 12, 2015 02:29
Notes from our BOF discussion about Drupal + Chef + Vagrant.
@dergachev
dergachev / Intro-to-Vagrant-for-Drupal.md
Last active December 12, 2015 02:19
Vagrant Talk (Drupalcamp NJ & Drupalcamp Ottawa)

Vagrant tutorial

  • Slideshow structure
    • About me - Alex Dergachev, co-founder @evolvingweb (follow me gh/twitter: @dergachev)
    • The problem
    • The solution - Chef & Virtualbox & Vagrant
      • Benefits
        • repo + sql dump + cookbooks + ubuntu ISO = Drupal stack
        • prod vs dev consistency
  • sysadmin code reuse