Skip to content

Instantly share code, notes, and snippets.

🔐
Remote employee forever!

Theodoros Ploumis theodorosploumis

🔐
Remote employee forever!
Block or report user

Report or block theodorosploumis

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@theodorosploumis
theodorosploumis / local.settings.php
Created Aug 26, 2015
Drupal 7.x local.settings.php
View local.settings.php
<?php
/**
* @file
* This is a local development configuration file.
*/
global $conf;
// Turn off Secure Pages. Secure Pages Module.
@theodorosploumis
theodorosploumis / config.rb
Created Nov 12, 2014
Config.rb for SCSS bootstrap project
View config.rb
#
# This file is only needed for Compass/Sass integration. If you are not using
# Compass, you may safely ignore or delete this file.
#
# Change this to :production when ready to deploy the CSS to the live server.
environment = :development
# Location of the theme's resources.
css_dir = "css"
@theodorosploumis
theodorosploumis / Drupal Undefined index Issue
Last active Aug 29, 2015
How to fix the error: "Notice: Undefined index: distribution_name in drupal_install_profile_distribution_name()..."
View Drupal Undefined index Issue
// Standard profile
UPDATE `mydatabese`.`system` SET `status` = '1' WHERE `system`.`filename` = 'profiles/standard/standard.profile';
// Minimal profile
UPDATE `mydatabese`.`system` SET `status` = '1' WHERE `system`.`filename` = 'profiles/minimal/minimal.profile';
@theodorosploumis
theodorosploumis / libreoffice_left_join_tables
Last active Aug 29, 2015
LibreOffice left Join Tables using unique id
View libreoffice_left_join_tables
// INDIRECT (Turns text into a range, if that range is valid)
// MATCH (Returns the relative position of an item in an array that matches a specified value. The function returns the position of the value found in the lookup_array as a number.)
=INDIRECT("SheetName.G"&((MATCH($D2;SheetName.$A$2:$A$103;1)+1)))
@theodorosploumis
theodorosploumis / Drupal function update line items table
Last active Aug 29, 2015
Drupal 7: field_data_commerce_line_items table is empty after Feeds import.
View Drupal function update line items table
/*
* Drupal 7: Using the latest EXPERIMENTAL Feeds module (7.x-2.x-dev from 2014-Dec-16) to import Commerce orders and line items the line items are not attached on each order.
* Technically, the database table "field_data_commerce_line_items" that keeps the reference for each order is empty
* and values only exist on "commerce_line_item" table. We are using Feeds to import data for "Orders" as also as "Product Line Items".
* With this simple function we fill up the "field_data_commerce_line_items" table from "commerce_line_item" table.
*/
// Update line items after feeds import (so table field_data_commerce_line_items has values)
function MYMODULE_update_product_line_items() {
@theodorosploumis
theodorosploumis / redirect codes
Created Jan 8, 2015
Drupal 7 - Redirect taxonomy term links on template.php
View redirect codes
/**
* hook_entity_info_alter().
* Redirect taxonomy term links to other pages.
*/
function MYTHEME_entity_info_alter(&$entity_info) {
$entity_info['taxonomy_term']['uri callback'] = 'clocky_taxonomy_term_uri';
}
/**
* Entity uri callback for taxonomy terms.
View node-and-npm-in-30-seconds.sh
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl http://npmjs.org/install.sh | sh
@theodorosploumis
theodorosploumis / gems_shared.sh
Last active Aug 29, 2015
Install Rubygems on shared hosting
View gems_shared.sh
#! bin/bash -e
# IMPORTANT. You need Ruby, wget and zip to be installed.
# 1. Create folders
mkdir ~/.gem ~/bin ~/lib ~/src
# 2. Download source
cd ~/src
wget http://production.cf.rubygems.org/rubygems/rubygems-2.4.5.zip
unzip rubygems-2.4.5.zip
@theodorosploumis
theodorosploumis / grstroupper.php
Last active Aug 29, 2015
Greek toUppercase converter
View grstroupper.php
<?php
/**
* CodeIgniter String Helpers
*
* @package OpenReceptor CMS
* @subpackage Helpers
* @category Helpers
* @author Dimitris Krestos
* @link http://vdw.staytuned.gr
@theodorosploumis
theodorosploumis / change_limit_function.php
Created Mar 25, 2015
Change drupal text field limit
View change_limit_function.php
<?php
$field_to_update = 'field_text_field_to_extend'; //Replace with field slug
$new_chars = '500'; //Replace with extended character limit
$result1 = db_query('ALTER TABLE {field_data_'.$field_to_update.'} CHANGE '.$field_to_update.'_value '.$field_to_update.'_value VARCHAR('.$new_chars.')');
$result2 = db_query('ALTER TABLE {field_revision_'.$field_to_update.'} CHANGE '.$field_to_update.'_value '.$field_to_update.'_value VARCHAR('.$new_chars.')');
$result3 = db_query('SELECT CAST(data AS CHAR(10000) CHARACTER SET utf8) data FROM {field_config} WHERE field_name = \''.$field_to_update.'\'');
foreach ($result3 as $result) {
$data = $result->data;
You can’t perform that action at this time.