Skip to content

Instantly share code, notes, and snippets.

🌍
Remote employee forever!

Theodoros Ploumis theodorosploumis

🌍
Remote employee forever!
View GitHub Profile
@theodorosploumis
theodorosploumis / crontab_script.sh
Last active Apr 10, 2020 — forked from dcrystalj/startup.bat
Setup Cron jobs with crontab for Drupal 7.x and 8.x (also how to clear caches, flush image styles etc)
View crontab_script.sh
# Open crontab with nano
# env EDITOR=nano crontab -e
# Examples from https://crontab.guru
# 0 03 * * 1-5
# */15 * * * *
# 33 * * * *
0 03 * * 1-5 /usr/local/bin/curl "http://www.domain.com/cron.php?cron_key=vHhbh21L3NXkiF5wKb5QXg3EHCp1ODDvN5DM0gH9OzO" > /dev/null 2>&1
@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 / Git_shared_hosting.sh
Last active Nov 18, 2015
Install Git on Shared hosting (Tested with Freebsd)
View Git_shared_hosting.sh
#!/bin/bash -e
# IMPORTANT. You must have gcc and wget installed
echo -n "Please enter the Git branch (eg 2.6.2): "
read branch
echo -n "Perl path (run 'which perl' to find the path): "
read perl_path
# Add bin in PATH
@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;
@theodorosploumis
theodorosploumis / Vagrantfile
Last active Feb 18, 2019 — forked from anthonysterling/Vagrantfile
Windows IE Vagrantfile
View Vagrantfile
# Usage: IE={box} vagrant up
#
# Eg. IE=XPIE6 vagrant up
boxes = {
"XPIE6" => "http://aka.ms/vagrant-xp-ie6",
"XPIE8" => "http://aka.ms/vagrant-xp-ie8",
"VistaIE7" => "http://aka.ms/vagrant-vista-ie7",
"Win7IE8" => "http://aka.ms/vagrant-win7-ie8",
"Win7IE9" => "http://aka.ms/vagrant-win7-ie9",
@theodorosploumis
theodorosploumis / Install_Phpstorm.sh
Last active Apr 10, 2020
Update phpstorm on Ubuntu linux.
View Install_Phpstorm.sh
#!/bin/bash -e
# IMPORTANT. My phpstom installation exists on /opt/phpstorm.
# Early Access program: https://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Early+Access+Program
# For stable releases try: https://data.services.jetbrains.com/products/download?code=PS&platform=linux
if [ "$(whoami)" != "root" ]
then
echo "Sorry, you are not root."
exit 1
fi
@theodorosploumis
theodorosploumis / administer_taxonomies.txt
Created Apr 28, 2015
Drupal 7 Administer Taxonomies views
View administer_taxonomies.txt
$view = new view();
$view->name = 'taxonomies';
$view->description = 'Administer Taxonomies';
$view->tag = 'default';
$view->base_table = 'taxonomy_term_data';
$view->human_name = 'Administer Taxonomies';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
View greeklish.php
function greeklish($string)
{
$replace_pairs = [
'Α' => 'A',
'Ά' => 'A',
'Β' => 'V',
'Γ' => 'G',
'Δ' => 'D',
'Ε' => 'E',
You can’t perform that action at this time.