Lots of people have asked, so here are a few common tasks you might do in your templates, as they would be written in ExpressionEngine vs. Craft.
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
# Config for GNU GRand Unified Bootloader (GRUB) | |
# /boot/grub/grub.cfg | |
# This grub.cfg file was created by Lance http://www.pendrivelinux.com | |
# Suggested Entries and the suggestor, if available, will also be noted. | |
# Sources: | |
# http://www.pendrivelinux.com/boot-multiple-iso-from-usb-via-grub2-using-linux/#more-5352 | |
# https://gist.github.com/jamiekurtz/26c46b3e594f8cdd453a | |
# https://gist.github.com/noisufnoc/e0053d738f5fbb679535 |
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 | |
# https://wiki.archlinux.org/index.php/Wake-on-LAN | |
sudo pacman -Syu ethtool | |
# d (disabled), p (PHY activity), u (unicast activity), m (multicast activity), | |
# b (broadcast activity), a (ARP activity), and g (magic packet activity) | |
ethtool <interface> | grep Wake-on | |
# If not g | |
ethtool -s <interface> wol g |
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
# GRUB2 gfxmenu Linux theme | |
# Designed for any resolution | |
# Global Property | |
title-text: "" | |
desktop-image: "background.jpg" | |
desktop-color: "#000000" | |
terminal-font: "Terminus Regular 14" | |
terminal-box: "terminal_box_*.png" | |
terminal-left: "0" |
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
#import the bpy module to access blender API | |
import bpy | |
#WARNING: this is written and tested for blender 2.79 | |
#blender 2.8 and newer will likely have a different python API | |
#create a property group, this is REALLY needed so that operators | |
#AND the UI can access, display and expose it to the user to change | |
#in here we will have all properties(variables) that is neccessary | |
class CustomPropertyGroup(bpy.types.PropertyGroup): |
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
# Config for GNU GRand Unified Bootloader (GRUB) (2) | |
# /boot/grub/grub.cfg | |
# or | |
# /boot/grub2/grub.cfg | |
# This grub.cfg file was created by Lance http://www.pendrivelinux.com | |
# Suggested Entries and the suggestor, if available, will also be noted. | |
# and then improved by Pysis. |
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/sh | |
# Import a remote database into a local database | |
# ---------------------------------------------- | |
# | |
# Based on http://danherd.net/quick-script-synchronise-from-a-remote-expressionengine-database/ | |
# | |
# Don’t forget chmod +x to make the script executable. | |
# | |
# Change the extension to .command to run the script directly from OS X Finder. |
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
$this->EE->load->driver('channel_data'); | |
$entries = $this->EE->channel_data->get_channel_entries($channel_id); | |
foreach($entries->row() as $row) | |
{ | |
$member = $this->EE->channel_data->get_member_entries($row->author_id); | |
$data_map = array( | |
'landscapes_1' => array( |
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 | |
// Look for this in mod.channel.php (around line 2635): | |
case 'custom_field' : | |
if (strpos($corder[$key], '|') !== FALSE) | |
{ | |
$end .= "CONCAT(wd.field_id_".implode(", wd.field_id_", explode('|', $corder[$key])).")"; | |
} | |
else | |
{ |
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
var $dateTime = new DateTime(); | |
$dateTime->setTimezone(new DateTimeZone('America/New_york')); | |
$dateTime->setTimestamp(time()); | |
$isDst = (bool)$dateTime->format('I') ? "y" : "n"; | |
$conf['daylight_savings'] = $isDst; |
NewerOlder