Skip to content

Instantly share code, notes, and snippets.

View dergachev's full-sized avatar

Alex Dergachev dergachev

View GitHub Profile
//run this code after going to https://www.google.ca/search?q=direct+flights+from+TLV
var links = document.querySelectorAll('div.std a.l'); // the selector might need to be tweaked??
var destinations = [];
for (var i = 0; i < links.length; ++i) {
var item = links[i];
item = item.href.replace(/^.*to\+/,'').replace(/&.*/,'');
destinations.push(item);
}
console.log(destinations.join(","));
@dergachev
dergachev / drupal-apachesolr-testing.sh
Last active December 20, 2015 11:49
Testing indexing of apachesolr.module
##
## Solr index testing tricks
##
## Tested with apachesolr-6.x-2.x (more recent versions might have different drush syntax
# to delete an index outside of drupal, after `drush solr-index` ran
rm -Rf /opt/solr/solr-home/data
service tomcat6 restart

First, highlights all search matches:

:set hlsearch

The following searches (and possibly highlight) any non-printable characters:

/[^[:print:]]
@dergachev
dergachev / vagrant-scp.md
Last active June 30, 2021 17:47
How to copy files into vagrant vm

Vagrant SCP

Do you need to copy a file to your Vagrant VM? Unfortunately there's no vagrant scp command as far as I know. But we can use vagrant ssh in a pinch:

cat ~/.gitconfig | vagrant ssh -- 'tee ~/.gitconfig'

Do you want to move over multiple files?

@dergachev
dergachev / upgrade-git-precise64.sh
Created July 3, 2013 14:28
Installs git 1.7.10 on Ubuntu 12.04 (Precise) using packages from the upcoming 12.10 (Quantal) release. Should work for i386 and amd64.
#
# Installs git 1.7.10 on Ubuntu 12.04 (Precise) using packages from
# the upcoming 12.10 (Quantal) release. Should work for i386 and amd64.
#
# Adapted from http://pastebin.com/TXeMw1CY
#
HOST_ARCH=`dpkg-architecture -qDEB_HOST_ARCH_CPU`
wget http://mirrors.us.kernel.org/ubuntu/pool/main/g/git/git_1.7.10.4-1ubuntu1_${HOST_ARCH}.deb \

vagrant-drupal repo structure

We're exploring alternative layouts for the vagrant-drupal repo structure.

Idea 1: project sub-repo

Assuming we want to keep Vagrantfile and Berksfile in git, and assuming that we have an existing Drupal project repo, the layout will be as follows:

Testing vagrant_drupal - Jun 26

  • need to have berkshelf installed (update README?) gem install berkshelf # got warning about minitar binary conflict, but it let me override existing vagrant plugin install vagrant-berkshelf
  • pull the attributes back into Vagrantfile
    • remove unnecessary attributes override from dna.json (eg. fga)
  • installing chef-11 failed: Error installing chef: Failed to build gem native extension. sh: 1: make: not found
    • fix: apt-get install -y build-essential
@dergachev
dergachev / _drupal-permissions.bookmarklet.md
Last active December 18, 2015 10:29
Drupal Permissions bookmarklet