spec
|--- apis #do not put into controllers folder.
|--- your_api_test_spec.rb
|--- controllers
|--- models
|--- factories
|--- views
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 | |
/** | |
* @Given /^I am viewing a product with the following related products:$/ | |
*/ | |
public function assertRelatedProducts(TableNode $relatedProducts) { | |
// First, create a product. | |
$product = (object) array( | |
'title' => 'Parent Product', | |
'type' => 'product', | |
'uid' => 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
#!/bin/bash | |
echo '✩✩✩✩ Update modules ✩✩✩✩' | |
drush -y up | |
echo '✩✩✩✩ Reinstall Drupal ✩✩✩✩' | |
drush -y site-install standard --account-name=admin --account-pass=admin | |
echo 'Disable modules' | |
drush -y dis dashboard overlay toolbar |
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 | |
DRUPAL_DIR='/Users/mrded/Sites/drupal8' | |
mysql -uroot -e'DROP DATABASE drupal8; CREATE DATABASE drupal8;' | |
touch ${DRUPAL_DIR}/sites/default/files/foo | |
sudo chmod -R 777 ${DRUPAL_DIR}/sites/default/files | |
rm -rf ${DRUPAL_DIR}/sites/default/files/* | |
#drush -y -r ${DRUPAL_DIR} site-install standard --account-name=admin --account-pass=admin --sites-subdir=default |
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
server { | |
listen 80; | |
listen [::]:80; | |
server_name domain.com; | |
autoindex off; | |
index index.php index.html; | |
root /srv/www/domain.com/public; |
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 | |
$baz = $qux = t('Arguments'); | |
$bar = array(); | |
foreach (module_implements('foo') as $module) { | |
$bar[] = module_invoke($module, 'foo', $baz, $qux); | |
} | |
# module_invoke_all('foo', $baz, $qux); |
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 | |
echo "Select on option:" | |
echo "1) Set up new PoPToP server AND create one user" | |
echo "2) Create additional users" | |
read x | |
if test $x -eq 1; then | |
echo "Enter username that you want to create (eg. client1 or john):" | |
read u | |
echo "Specify password that you want the server to use:" | |
read p |
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
// Call method. | |
var method = (success ? 'start' : 'stop'); | |
obj[method](); | |
// Concatenation. | |
['first', 'name'].join(' '); // = 'first name'; | |
['milk', 'coffee', 'suger'].join(', '); // = 'milk, coffee, suger' | |
// Value by default. | |
var name = myName || 'No name'; // Returns 'No name' when myName is null or undefined |
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$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
form i.icon.error { | |
color: $assertive; | |
} | |
form input + i.icon.error { | |
display: none; | |
margin-left: 8px; | |
} | |
form.ng-submitted input.ng-invalid + i.icon.error { |