Skip to content

Instantly share code, notes, and snippets.

View athaller's full-sized avatar
💭
Making Magic

athaller

💭
Making Magic
  • $date :: PHP :: Systems :: Dev Ops
  • East :: Web
View GitHub Profile
@pustynnykh
pustynnykh / block system main view
Created August 27, 2014 11:13
Drupal new theme suggestion for block system main with view. Put it to template.php
function theme_preprocess_block(&$vars) {
$block = $vars['block'];
if($block->module == 'system' && $block->delta == 'main' && function_exists('views_get_page_view') && views_get_page_view()){
$view_object = views_get_page_view();
$vars['theme_hook_suggestions'][] = 'block__views__' . $view_object->name;
}
}
@dergachev
dergachev / ubuntu-eol.md
Last active December 31, 2024 03:23
What to do when your ubuntu distro is End-of-Life

Let's say you're using Ubuntu 13.04 (Raring Ringtail, released in April 2013) and it just went End-of-Life on you, because it's supported for only 6 months, and the deprecated packages are taken down after 12 months.

You'll probably figure this out the hard way. When you run sudo apt-get update, it will eventually report these errors:

Ign http://archive.ubuntu.com raring-updates/universe Sources/DiffIndex
Err http://security.ubuntu.com raring-security/main Sources
  404  Not Found [IP: 91.189.91.15 80]
Err http://security.ubuntu.com raring-security/universe Sources
  404  Not Found [IP: 91.189.91.15 80]
@christoomey
christoomey / json-vim-config.md
Last active January 4, 2018 18:24
Configuration for better JSON editing in Vim

Install jsonlint to act as syntastic json checker:

$ npm install jsonlint -g

Tell syntatastic about it:

" in your ~/.vimrc
@fluffybeing
fluffybeing / subcomands
Created May 13, 2014 10:40
python-cliff subcommands
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Cliff sample app
~~~~~~~~~~~~~~~~
"""
import os
import sys
import logging
@soarez
soarez / ca.md
Last active June 11, 2025 03:40
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

Styling the Drupal Commerce Shopping Cart Block

This block is provided by a view. Note how the markup changes when cart is empty vs not empty. This stuff is very tricky to style.

Cart Empty

<div id="block-views-shopping-cart-zz-block" class="block block-views contextual-links-region">
@stephenll
stephenll / .bash_profile
Created February 2, 2014 02:45 — forked from jernejcic/.bash_profile
.bash_profile file on Mac OS X
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases.
# Much of this was originally copied from:
# http://natelandau.com/my-mac-osx-bash_profile/
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
@juampynr
juampynr / readme.txt
Last active March 10, 2020 10:32
JQuery + Drupal block example. Used to compare with an AngularJS + Drupal approach. Details at https://www.lullabot.com/blog/article/move-logic-front-end-angularjs
JQuery + Drupal block example.
Used to compare with an AngularJS + Drupal approach.
Details at https://www.lullabot.com/blog/article/move-logic-front-end-angularjs

Use Drush to Export/Import a Drupal MySQL Database Dump File

Export Database to File

[...] Behold the power of Drush (once you are ssh'd in and navigated to your drupal root directory)

drush cc
drush sql-dump > ~/my-sql-dump-file-name.sql

Those two commands clear all the Drupal caches and then dump the sql database to a file in your home directory. Awesome sauce!

@mrded
mrded / ctools_popup.php
Last active September 19, 2017 13:21
Drupal: Example of reloading ctools modals.
<?php
ctools_include('ajax');
ctools_include('modal');
ctools_modal_add_js();
drupal_add_library('module', 'fancybox.modal'); // Include js here.
$path = 'some_path/nojs';
$content = ctools_modal_text_button($text, $path, '', $class);