Skip to content

Instantly share code, notes, and snippets.

@aczietlow
aczietlow / gist:7337098
Created November 6, 2013 14:41
extract command
# extract: Extract most know archives with one command
# ---------------------------------------------------------
extract () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar e $1 ;;
*.gz) gunzip $1 ;;
@aczietlow
aczietlow / selenium-php-webdriver-cheatsheet.md
Last active March 6, 2024 22:48 — forked from huangzhichong/selenium-webdriver-cheatsheet.md
Cheat sheet for using php webdriver (facebook/webdriver).

Webdriver PHP API workthough

  • Open a browser

    # start an instance of firefox with selenium-webdriver
    
    $browser_type = 'firefox'
    $host = 'http://localhost:4444/wd/hub'
    

$capabilities = array(\WebDriverCapabilityType::BROWSER_NAME => $browser_type);

@aczietlow
aczietlow / profileMappingMapping.sh
Last active October 25, 2023 19:49
Bashing my head in
#! /bin/bash
# pipe input from column
#
# Usage
#
# ex. cat output.txt | column -t | ./profileMappingMapping.sh
#
# for funzies you can pipe out to column again
#
@aczietlow
aczietlow / vhost
Last active April 9, 2023 14:26
apache 2.4 vhost example
<VirtualHost *:80>
ServerName {zietlow.dev}
ServerAlias {*.zietlow.dev}
DocumentRoot {/home/aczietlow/Sites/zietlow/dev/www}
# Optional per project error logging.
ErrorLog {/home/aczietlow/Sites/zietlow/dev/zietlow.log}
<Directory {/home/aczietlow/Sites/zietlow/dev/www/}>
Options Indexes FollowSymLinks MultiViews
@aczietlow
aczietlow / prepare-commit-msg
Last active March 2, 2023 09:27
Git hook for prepare commit msg. Looks for an issue number in the branch name (a number between 3-9 digits long) and prepends it to the commit message.
#!/bin/sh
#
# A hook script to prepare the commit log message.
# Called by "git commit" with the name of the file that has the
# commit message, followed by the description of the commit
# message's source. The hook's purpose is to edit the commit
# message file. If the hook fails with a non-zero status,
# the commit is aborted.
#
# To enable this hook, rename this file to "prepare-commit-msg" and
diff --git a/config_ignore_drush/composer.json b/config_ignore_drush/composer.json
new file mode 100644
index 0000000..70e4fcd
--- /dev/null
+++ b/config_ignore_drush/composer.json
@@ -0,0 +1,15 @@
+{
+ "name": "drupal/config_ignore_drush",
+ "type": "drupal-drush",
+ "description": "Command replacement for config:import and config:export that applies sync and active storage filters rather than just sync.",
@aczietlow
aczietlow / gist:1d2c8f7694e1471f2874
Created December 8, 2014 15:38
Behat tests for checkout css properties
<?php
/**
* @Given /^The element "(?P<selector>[^"]*)" should have a css property "(?P<property>[^"]*)" with a value of "(?P<value>[^"]*)"$/
*
* @TODO Need to find a way to test for css styles on elements.
* Or possibly we should just be checking the markup, and not the styling... Research this more.
*/
public function assertElementHasCssValue($selector, $property, $value)
{
$page = $this->getSession()->getPage();
@aczietlow
aczietlow / fapi_states_example.php
Created June 2, 2016 19:57
Drupal 8 form state example
$form['auto_create_bundle'] = [
'#type' => 'select',
'#title' => $this->t('Store new items in'),
'#options' => $bundles,
'#default_value' => $selection_handler_settings['auto_create_bundle'],
'#access' => count($bundles) > 1,
'#states' => [
'visible' => [
':input[name="settings[handler_settings][auto_create]"]' => ['checked' => TRUE],
],
@aczietlow
aczietlow / .bash_profile.sh
Last active May 1, 2018 05:44
bash stuff for the mac
###########################################
# System Specific
###########################################
#mysql
#export PATH="$PATH:/usr/local/mysql/bin/mysql"
#alias mysql='/usr/local/mysql/bin/mysql'
#alias mysqldump='/usr/local/mysql/bin/mysqldump'
#alias mysqladmin='/usr/local/mysql/bin/mysqladmin'