This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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() { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* CodeIgniter String Helpers | |
* | |
* @package OpenReceptor CMS | |
* @subpackage Helpers | |
* @category Helpers | |
* @author Dimitris Krestos | |
* @link http://vdw.staytuned.gr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function greeklish($string) | |
{ | |
$replace_pairs = [ | |
'Α' => 'A', | |
'Ά' => 'A', | |
'Β' => 'V', | |
'Γ' => 'G', | |
'Δ' => 'D', | |
'Ε' => 'E', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @file | |
* This is a local development configuration file. | |
*/ | |
global $conf; | |
// Turn off Secure Pages. Secure Pages Module. |
OlderNewer