Skip to content

Instantly share code, notes, and snippets.

View amitaibu's full-sized avatar

Amitai Burstein amitaibu

View GitHub Profile
@amitaibu
amitaibu / .gitignore
Last active October 9, 2016 13:21
Form and RESTful validations
client_session_key.aes
*.db3
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
import Data.Text (Text)
import Data.Time.Clock
import Yesod
CREATE USER root WITH PASSWORD 'root';
CREATE DATABASE yesod;
GRANT ALL PRIVILEGES ON DATABASE yesod TO root;
SELECT *
FROM company
LEFT OUTER JOIN group_membership
ON (company.id = group_membership.company_id AND group_membership.user_id=1)
WHERE group_membership.company_id IS NULL
// $this->entityManager->getStorage('og_membership')
// ->willReturn($this->entityStorage->reveal());
//
// $this->entityManager->getEntityTypeFromClass('Drupal\og\Entity\OgMembership')
// ->willReturn('og_membership');
//
// // Create a mocked Og Membership entity.
// $membership_entity = $this->prophesize(OgMembershipInterface::class);
//
print '<div class="debug">';
print_r($some_val);
print '</div>';
print_r($this->getSession()->getPage()->find('css', '.debug')->getHtml());
@amitaibu
amitaibu / si
Last active September 8, 2016 12:01
#!/usr/bin/env bash
drush si --account-pass=admin -y && drush en devel kint og_ui -y
drush php-eval "\Drupal\og\Og::groupTypeManager()->addGroup('node', 'page');"
drush php-eval "\Drupal\og\Og::createField(\Drupal\og\OgGroupAudienceHelper::DEFAULT_FIELD, 'node', 'article');"
drupal create:users authenticated --limit="10" --password="5" --time-range="604800"
drupal create:nodes page --limit="25" --title-words="5" --time-range="604800"
elm-package install krisajenkins/elm-exts -y
elm-package install elm-community/json-extra -y
alias phpcs="./vendor/bin/phpcs"
phpcs --config-set installed_paths /Library/WebServer/Documents/Danel/vendor/drupal/coder/coder_sniffer
phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,js,css,info,txt,md modules
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>