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 | |
TOKEN=`curl -sS -X POST -H "Content-Type: application/x-www-form-urlencoded" -d "_username=ENCODEDEMAIL%40gmail.com&_password=ENCODEDPASSWORD" https://diffy.website/api/login_check | grep -o "token\":.*\"}" | sed "s/token\":\"//g" | sed "s/\"}//g"` | |
if [ -z "$TOKEN" ] | |
then | |
echo "Problem authenticating." | |
exit 1 | |
fi |
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
Command+E recent files | |
Ctrl+T refactor this: rename, variable, move method, interface | |
Command+N create constructor, getters, setters | |
Option+Enter initialize variable constructor | |
Shift+Shift search everywhere | |
Command+Up browse in current file’s folder | |
Command+Option+O search symbol | |
Command+, Settings | |
Control+G multiple cursors of same word | |
Control+V, Control+H windows splits (manually added) |
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 | |
/** | |
* @file | |
* Contains \OpenEDUSubContext. | |
*/ | |
use Behat\Behat\Hook\Scope\BeforeScenarioScope; | |
use Drupal\DrupalExtension\Context\DrupalSubContextBase; | |
use Behat\Behat\Context\SnippetAcceptingContext; |
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
# Lamp + PHP CS + Drush | |
image: sharpe/drupal:latest | |
pipelines: | |
branches: | |
8.x-1.x: | |
- step: | |
script: | |
#start mysql and create drupal db | |
- service mysql start |
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 | |
/** | |
* Enable Google Analytics module. | |
*/ | |
function openy_update_8011() { | |
// Enable module. | |
\Drupal::service('module_installer')->install(['google_analytics']); | |
} |
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 | |
# Written in bash | |
# echo $SHELL | |
# change these values | |
APIKEY='8AAABBBCCC5' | |
PROJECTID='111222' | |
nid=`curl -sS --header "x-api-key: $APIKEY" --request POST https://backtrac.io/api/project/$PROJECTID/snapshot | sed 's/.*\"nid\":\"\([^\"]*\).*/\1/'` |
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 | |
define('LOGFILE', '/tmp/callback.log'); | |
if ($_SERVER['REQUEST_METHOD'] == 'GET') { | |
if (file_exists(LOGFILE)) { | |
print file_get_contents(LOGFILE); | |
} | |
else { | |
print 'Log file does not exist.'; |
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
var page = require('webpage').create(), | |
address, output, size; | |
if (phantom.args.length < 4 || phantom.args.length > 5) { | |
console.log('Usage: viewport.js URL filename sizeX sizeY'); | |
phantom.exit(); | |
} else { | |
address = phantom.args[0]; | |
output = phantom.args[1]; | |
sizeX = phantom.args[2]; |
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
// Code provided by Acquia. | |
// Non balanced servers (dev and stage) don't have this problem. | |
if (!empty($conf['reverse_proxy_addresses'])) { | |
$ips = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']); | |
$ips = array_map('trim', $ips); | |
// Add REMOTE_ADDR to the X-Forwarded-For list (the ip_address function will | |
// also do this) in case it's a 10. internal AWS address; if it is we should | |
// add it to the list of reverse proxy addresses so that ip_address will | |
// ignore it. | |
$ips[] = $_SERVER['REMOTE_ADDR']; |
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
default: | |
suites: | |
default: | |
contexts: | |
- Drupal\DrupalExtension\Context\MinkContext | |
- FeatureContext | |
extensions: | |
Behat\MinkExtension: | |
base_url: http://mywebsite.com | |
goutte: |