This file contains hidden or 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 | |
// For the following query: | |
// UPDATE `pathauto_state` SET `pathauto`=1 WHERE `entity_type` = 'node' | |
$update_auto_aliases = db_update('pathauto_state') | |
->fields(array( | |
'pathauto' => 1, | |
)) | |
->condition('entity_type', 'node', '=') | |
->execute(); | |
?> |
This file contains hidden or 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
afghanistan|Afghanistan | |
albania| Albania | |
algeria| Algeria | |
american samoa| American Samoa | |
andorra| Andorra | |
angola| Angola | |
anguilla| Anguilla | |
antarctica| Antarctica | |
antigua and barbuda| Antigua and Barbuda | |
argentina| Argentina |
This file contains hidden or 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
#mc_embed_signup | |
form#mc-embedded-subscribe-form.clear.sign-up(action='{{YOUR_MC_GENERATED_ACTION}}', method='post', name='mc-embedded-subscribe-form', target='_blank', novalidate='novalidate') | |
label(for='mce-EMAIL') Subscribe to our mailing list | |
input#mce-EMAIL.email.sign-up__email(type='email', value='', name='EMAIL', placeholder='email address', required='required') | |
div(style='position: absolute; left: -5000px;') | |
input(type='text', name='{{YOUR_MC_GENERATED_NAME}}', value='') | |
input#mc-embedded-subscribe.button.sign-up__submit(type='submit', value='Sign Up', name='Sign Up') |
This file contains hidden or 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
<Directory "/Users/YOURUSERNAMEHERE/Sites"> | |
DirectoryIndex index.php index.cfm index.html index.htm | |
Options Indexes FollowSymLinks MultiViews | |
AllowOverride All | |
Require all granted | |
#Default environment variables | |
SetEnv ENVIRONMENT "local" | |
SetEnv DB1_USER "YOUR_DB_USERNAME" | |
SetEnv DB1_PASS "YOUR_DB_PASSWORD" |
This file contains hidden or 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
PREREQUISITES | |
============= | |
Install homebrew (if not already installed) | |
In terminal: | |
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
Note: May prompt to install xcode command line tools. If so, install them | |
Create a Sites folder in your home directory (if you don’t already have one) |
This file contains hidden or 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 | |
# Config vars | |
sites_path="$(eval echo ~${SUDO_USER})/Sites" | |
conf_file="${sites_path}/_conf/httpd-vhosts.conf" | |
hosts_path="/etc/hosts" | |
# Permissions | |
if [ "$(whoami)" != "root" ]; then | |
echo "Root privileges are required to run this, try running with sudo..." |
This file contains hidden or 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
// Get tricky with some UL's!! | |
ul { | |
li { | |
color: $darkGray; | |
list-style-type: none; | |
&:before { | |
color: $brightTeal; | |
content:"\2022"; | |
font-size:1.5em; | |
padding-right:.25em; |
This file contains hidden or 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
"scripts": { | |
"prepublish": "find node_modules -name '*.info' -exec rm -f {} \\;" | |
}, |
This file contains hidden or 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 record | |
$rec = $fm->createRecord('layout_name', '$data_array'); | |
$result = $rec->commit(); | |
//new add command | |
$newAdd = $fm->newAddCommand('layout_name', $data_array); | |
$result = $newAdd->execute(); | |
//Second and main difference is what they return to $result variable. The 'createRecord()' statement returns an integer value to know the status of record creation process(whether succeed or failed). But the 'newAddCommand()' returns a bunch of information for the new created record along with record id. |
This file contains hidden or 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 | |
// Hide/display stuff for users who are already registered | |
$query = new EntityFieldQuery(); | |
$query | |
->entityCondition('entity_type', 'registration') | |
->propertyCondition('entity_id', $node->field_product_ref['und'][0]['product_id']); | |
$result = $query->execute(); | |
//print_r($result['registration'][10]); | |
$ids = array_keys($result['registration']); | |
$registrations = entity_load('registration', $ids); |
NewerOlder