- Cannot currently specify strict limiting of array keys (issue)
- Array shapes are assumed to be incomplete and allow additional key/value assignments by default.
- The Drupal coding standards don't currently play nicely with multiline array shapes and type specifications.
@param
specifications warn about not having a variable name on the same line
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
; Change this to set the current farm size. This can change as the farm levels up. | |
Const $farm_size = 20 | |
Dim $farm_x[$farm_size][$farm_size] = [[0]] | |
Dim $farm_y[$farm_size][$farm_size] = [[0]] | |
; Calculate farm square dimensions for traversal. | |
$res_height = @DesktopHeight | |
$res_width = @DesktopWidth | |
$square_width = 50 |
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\yaml_content\EventSubscriber; | |
use Drupal\block\Entity\Block; | |
use Drupal\block_content\Entity\BlockContent; | |
use Drupal\Core\Config\ConfigFactoryInterface; | |
use Drupal\Core\Entity\EntityStorageException; | |
use Drupal\yaml_content\Event\EntityPostSaveEvent; | |
use Drupal\yaml_content\Event\YamlContentEvents; |
Add the git-pr
file into as an executable in your local PATH. For example, if ~/bin
is in your PATH, then the following should work:
# Add and save script content.
vi ~/bin/git-pr
# Make the script executable.
chmod u+x ~/bin/git-pr
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.d/Vagrantfile | |
# Local configuration to use across all Vagrant machines | |
Vagrant.configure("2") do |config| | |
config.vm.provider :virtualbox do |vb| | |
host = RbConfig::CONFIG['host_os'] | |
# Force settings for allowed resources | |
if host =~ /darwin/ |
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 | |
############################## | |
# Merge the current branch into multiple other local branches. | |
# | |
# TODO: Add the option to pass additional arguments to merge commands | |
############################## | |
# Determine the current branch name | |
source=$(git symbolic-ref HEAD 2> /dev/null) || source=$(git rev-parse --short HEAD 2> /dev/null); |
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
#!/usr/bin/env ruby | |
############################## | |
# Create local tracking branches for all remote branches | |
# that don't have local branches with a matching name. | |
# | |
# TODO: Add remote name as an agument | |
# TODO: Add option for pass-through grep arguments to filter branches | |
############################## |
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
#! /usr/bin/env ruby | |
# ~/.git_hooks/lib/issue_numbers.rb | |
$issue_pattern = /\d{5}(?=-)/ | |
#require 'git' | |
#g = Git.open(working_dir, :log => Logger.new(STDOUT)) |
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
/** | |
* Directive for compiling HTML loaded on-the-fly. | |
* | |
* Compiles the assigned scope attribute and inserts it inside the current element. | |
* | |
* Usage: Assign scope value name containing content to be compiled and inserted | |
* to compile-content attribute. | |
* | |
* Example: <div compile-content="htmlContent"></div> | |
* This assumes that $scope.htmlContent contains a sanitized HTML string. |
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 | |
$query = new EntityFieldQuery(); | |
$entities = $query->entityCondition('entity_type', 'node') | |
->entityCondition('bundle', 'event') | |
->propertyCondition('status', 1) | |
->fieldCondition('field_date', 'value', array('2011-03-01', '2011-03-31'), 'BETWEEN') | |
->fieldOrderBy('field_date', 'value', 'ASC') | |
->execute(); | |
$nodes = node_load_multiple(array_keys($entities['node'])); |
NewerOlder