Skip to content

Instantly share code, notes, and snippets.

View dergachev's full-sized avatar

Alex Dergachev dergachev

View GitHub Profile
@rusilko
rusilko / dev_start.sh
Last active April 15, 2017 04:48
Simple bash script to quickly fire up your Rails working environment.
#!/bin/bash
# Function displaying wrong usage information
# Proper usage is: ./dev_start.sh Rails-Project-Folder
usage()
{
cat << EOF
usage: $0 Rails-Project-Folder
EOF
}
@wsargent
wsargent / docker_cheat.md
Last active August 31, 2023 12:10
Docker cheat sheet
# This file is part of VISVIS. This file may be distributed
# seperately, but under the same license as VISVIS (LGPL).
#
# images2gif is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# images2gif is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@neil-s
neil-s / README.md
Last active December 27, 2015 10:29 — forked from JoelBesada/README.md

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.

  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.
@praveenvvstgy
praveenvvstgy / README.md
Last active December 27, 2015 13:19 — forked from JoelBesada/README.md

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.
@mijoharas
mijoharas / README.md
Last active December 27, 2015 16:09 — forked from JoelBesada/README.md
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.
@cesarmiquel
cesarmiquel / README.md
Last active December 27, 2015 20:39 — forked from JoelBesada/README.md
Make Drupal issue queue information box sticky
@frenchesco
frenchesco / backtick-edit-page.md
Last active October 25, 2018 09:27 — forked from JoelBesada/README.md
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.
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 25, 2024 02:01
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

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:

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

Results

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"