Skip to content

Instantly share code, notes, and snippets.

@tedbow
tedbow / test_constructor.php
Created May 21, 2016 19:59
test_constructor.php
/**
* Constructs a new UserLoginResource object.
*
* @param \Drupal\Core\Flood\FloodInterface $flood
* The flood controller.
* @param \Drupal\user\UserStorageInterface $user_storage
* The user storage.
* @param \Drupal\Core\Access\CsrfTokenGenerator $csrf_token
* The CSRF token generator.
* @param \Drupal\user\UserAuthInterface $user_auth
@tedbow
tedbow / wgit-apply.sh
Created May 20, 2016 12:19
Apply a patch with saving it
path=${1}
if [ $1 ]
then
wget -q -O - $1 | git apply -
else
echo "please enter url"
exit
fi
git commit -m "Something terribly misguided" (1)
$ git reset --soft HEAD~
@tedbow
tedbow / checkout-branch-directory.txt
Created March 23, 2016 21:03
Checkout directory from git branch
#http://stackoverflow.com/questions/2668886/git-copy-all-files-in-a-directory-from-another-branch
git checkout master -- dirname
@tedbow
tedbow / single-simpletest.txt
Last active March 23, 2016 18:28
Run a single simpletest in Drupal 8
#https://www.drupal.org/node/645286
php core/scripts/run-tests.sh --url http://example.com/ --class "Drupal\module_name\Tests\TestClass::testMethod"
/**
* Enables field_formatter_settings and borealis
*/
function ilr_update_7003() {
variable_set('ilr_test', 'test-value');
}