Skip to content

Instantly share code, notes, and snippets.


Alex Dergachev dergachev

View GitHub Profile
levelsio / btc-eth-dca-buy.php
Last active May 14, 2022
This script runs daily and "Dollar Cost Average"-buys $40 BTC and $10 ETH per day
View btc-eth-dca-buy.php
// by @levelsio
// 2017-08-23
// 1) buy $40/day BTC
// 2) buy $10/day ETH

After running homesick clone dotfiles ...

E492: Not an editor command: Plugin 'gmarik/Vundle.vim'
line   96:
E492: Not an editor command: Plugin 'gmarik/vundle'
line   97:
E492: Not an editor command: Plugin 'kana/vim-fakeclip'
line   98:
E492: Not an editor command: Plugin 'jtratner/vim-flavored-markdown'
RichardBronosky /
Last active Jun 2, 2022 — forked from jexchan/
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C ""
amirkdv / mechanic.rb
Last active Aug 29, 2015
Login, click through, and get the data you need from an HTTPS site
View mechanic.rb
#!/usr/bin/env ruby
# Use Mechanize to automatically login, click through, and fetch the data you
# need from an HTTPS site. The following works for the McGill admission portal.
# ruby mechanic.rb
# # Ready for Review
# # Ready for Review
require 'rubygems'
require 'mechanize'
otobrglez / jaccard_recommendation.rb
Last active Nov 20, 2020
Simple recommendation system written in Ruby based on Jaccard index.
View jaccard_recommendation.rb
# Simple Recommendation Engine in Ruby
# Visit:
# Author: Oto Brglez <>
class Book <
def words
@words ||= self.title.gsub(/[a-zA-Z]{3,}/).map(&:downcase).uniq.sort

When debugging Drupal, I often stick dpm($some_array, "my array"); calls to see what the value of $some_array is. This fails spectacularly if the code I'm debugging is run very late in the request after drupal_get_messages() has already been called. (Eg most hook_preprocess_THEMEHOOK functions).

In that case, I've found it useful to add these helper functions somewhere (any enabled custom module, or even index.php), use them instead of dpm. They'll serialize objects to apache's error_log (wherever that is), which you can track by opening a terminal tab and running:

tail -f /var/log/apache2/error.log | tr '%' "\n"
lelandbatey /
Last active Jun 9, 2022
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!


This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"


frenchesco /
Last active Oct 25, 2018 — forked from JoelBesada/
A backtick command to make a page editable

This is a command for Backtick. It allows you to make a web page editable. Once you run the command you can click anywhere on the page and delete elements or type something.

To use this:

  1. Download Backtick.
  2. Copy the following ID of this Gist 7556270.
  3. Paste the ID into the custom commands field in the Backtick settings. You can easily access the settings by clicking the Backtick icon on the command execution console.
cesarmiquel /
Last active Dec 27, 2015 — forked from JoelBesada/
Make Drupal issue queue information box sticky
mijoharas /
Last active Dec 27, 2015 — forked from JoelBesada/
Backtick command for is it down.

This is an example command for Backtick. A Backtick command consists of some executable JavaScript and a bit of metadata in JSON.

Here are the required steps to create a command:

  1. Create a new Gist with a command.js and command.json file, or simply fork this one.

  2. Write your JavaScript in command.js. This will be injected into and executed on the page the user is currently on when they run it.

  3. Add some metadata to the command.json file:

  • name: The name of the command.