- Install fish via Brew
- Optionally install Oh My Fish!
- Add fish to known shells
- Set default shell to fish
brew install fish
curl -L https://get.oh-my.fish | fish
Twig coding standards | |
https://www.drupal.org/node/1823416 | |
Filters - Modifying Variables In Twig Templates | |
https://www.drupal.org/node/2357633 | |
{% for i, value in content.field_app_prod_toggle_products %} | |
{% if node.field_app_prod_toggle_products[i].entity %} | |
{% if i == 0 %} |
/* | |
* decaffeinate suggestions: | |
* DS102: Remove unnecessary code created because of implicit returns | |
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md | |
*/ | |
// To get the `action` prop: | |
// | |
// 1. Go to your dashboard on mailchimp.com and navigate | |
// to Lists > Signup Forms > Embedded Forms. | |
// |
<? | |
$curl = curl_init(); | |
curl_setopt_array($curl, array( | |
CURLOPT_RETURNTRANSFER => 1, | |
CURLOPT_URL => 'http://www.google-analytics.com/collect?v=1&tid=[UA-XXXXXXXXX-1]&cid=[RANDOM_INTEGER_OR_GUID]&t=event&ec=[EVENT_CATEGORY]&ea=[EVENT_ACTION]&el=[EVENT_LABEL]', | |
CURLOPT_USERAGENT => 'Vanity-URL-Tracker', | |
)); | |
$resp = curl_exec($curl); | |
curl_close($curl); | |
header("HTTP/1.1 301 Moved Permanently"); |
brew install fish
curl -L https://get.oh-my.fish | fish
<script type="text/javascript"> | |
jQuery( document ).ready( function( $ ) { | |
var ms_one_day = 1000 * 60 * 60 * 24; | |
var form_id = '1'; | |
var date_format = 'dd-mm-yy'; | |
var field_date_start = $( '#input_' + form_id + '_1' ); | |
var field_date_end = $( '#input_' + form_id + '_2' ); |
#Drupal 8 snippets
##Create absolute URL:
$options = ['absolute' => TRUE];
$url_object = Drupal\Core\Url::fromRoute('entity.node.canonical', ['node' => $nid], $options);
// will output http://example.com/path-to-my-node
##Create absolute link object (and inner span):
# Taxonomy terms: | |
- https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_taxonomy_term-php | |
# Menu links: | |
- https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_menu_link-php | |
# File items: | |
- https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_file-php | |
# Nodes: |
The API we are creating in this gist will follow these rules :
password
Grant Type only (no need for Authorization pages and such).v1.api.example.com
)The API will be written in PHP with the Symfony 2 framework. The following SF2 bundles are used :
First of all you need to be able to run MAMP in port 80. This is a "heat check" if you don't have any process jamming http ports. You can check it like this:
sudo lsof | grep LISTEN
If you do happen to have any process with something like this *:http (LISTEN)
, you are in trouble. Before with adventure check if it isn't MAMP itself (yeah, you should close that beforehand)
ps <pid of that process>
If you don't see MAMP, you are in good hands, I have just the thing for you: