View htaccess
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
# Redirect old.org.il to www.new.org/he | |
# test at: https://htaccess.madewithlove.com/ | |
RewriteCond %{HTTP_HOST} ^old\.org\.il$ [OR] | |
RewriteCond %{HTTP_HOST} ^\w+\.old\.org\.il$ | |
RewriteRule ^(.*)$ https://www.new.org/he/$1 [R=301,L] |
View mymodule.module
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 | |
* mymodule module file. | |
*/ | |
use Drupal\Core\Form\FormStateInterface; | |
/** |
View NycTestForm.php
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 | |
namespace Drupal\nyc_common\Form; | |
use Drupal\Core\Form\FormBase; | |
use Drupal\Core\Form\FormStateInterface; | |
use Drupal\nyc_map\Utils\NycLocationServices; | |
use Drupal\nyc_map\Utils\NycGeometryUtility; | |
use Drupal\Core\Ajax\AjaxResponse; |
View page.html.twig
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
{# | |
/** | |
* @file | |
* Example subtheme implementation to display a single page. | |
* | |
* The doctype, html, head and body tags are not in this template. Instead they | |
* can be found in the html.html.twig template in this directory. | |
* | |
* Available variables: |
View html.html.twig
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
{# | |
/** | |
* @file | |
* A subtheme implementation for the basic structure of a single Drupal page. | |
* | |
* Variables: | |
* - logged_in: A flag indicating if user is logged in. | |
* - root_path: The root path of the current page (e.g., node, admin, user). | |
* - node_type: The content type for the current node, if the page is a node. | |
* - head_title: List of text elements that make up the head_title variable. |
View node.html.twig
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
{# | |
/** | |
* @file | |
* Default theme implementation to display a node. | |
* | |
* Available variables: | |
* - node: The node entity with limited access to object properties and methods. | |
* Only method names starting with "get", "has", or "is" and a few common | |
* methods such as "id", "label", and "bundle" are available. For example: | |
* - node.getCreatedTime() will return the node creation timestamp. |
View block.html.twig
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
{# | |
/** | |
* @file | |
* Default theme implementation to display a block. | |
* | |
* Available variables: | |
* - plugin_id: The ID of the block implementation. | |
* - label: The configured label of the block if visible. | |
* - configuration: A list of the block's configuration values. | |
* - label: The configured label for the block. |
View Vagrantfile
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
Vagrant.configure("2") do |config| | |
#config.vm.synced_folder "C:\\Users\\jtarleton\\vagrant", "/var/winroot" | |
#config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "192.168.33.10" | |
#config.vm.provision :shell, path: "bootstrap.sh" | |
config.vm.define "weblocal" do |weblocal| | |
weblocal.vm.box = "ubuntu/precise64" | |
weblocal.vm.synced_folder "C:\\vagrantvm\\adid", "/var/www/adid" | |
weblocal.vm.synced_folder "C:\\Users\\jtarleton\\vagrant_www", "/var/winroot" | |
weblocal.vm.synced_folder "C:\\Users\\jtarleton\\vagrant_web\\home\\jtarleton\\tmp", "/home/jtarleton/tmp" | |
weblocal.vm.network "private_network", ip:"192.168.33.10" |
View PatIndex.sql
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
CREATE DEFINER=`root`@`localhost` FUNCTION `PatIndex`(pattern VARCHAR(255), tblString VARCHAR(255)) RETURNS int(11) | |
DETERMINISTIC | |
BEGIN | |
DECLARE i INTEGER; | |
SET i = 1; | |
myloop: WHILE (i <= LENGTH(tblString)) DO | |
IF SUBSTRING(tblString, i, 1) REGEXP pattern THEN |
View JtAwesomeHelpers.class.php
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 | |
class JtAwesomeHelpers | |
{ | |
public static function SimpleMailer($subject = 'DW Operation Complete', $body='', $htmlbody = '', $to = 'you@yourdomain.org') { | |
$headers = 'MIME-Version: 1.0' . "\r\n"; | |
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n" . | |
'From: Your Mailer <noreply@yourdomain.org>' . "\r\n" . |
NewerOlder