This file contains 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
[ | |
{ | |
"provider_name": "YouTube", | |
"provider_url": "https://www.youtube.com/", | |
"endpoints": [ | |
{ | |
"schemes": [ | |
"https://*.youtube.com/watch*", | |
"https://*.youtube.com/v/*", | |
"https://youtu.be/*" |
This file contains 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
javascript:(function(){ | |
const ticketNumber = | |
/* If we are on a Jira board. */ | |
location.search.match('[?&]selectedIssue=(.*?)([&]|$)')?.[1] || | |
/* If we are on the ticket page. */ | |
location.pathname.split('/').pop(); | |
const ticketSummary = document.getElementsByTagName('h1')[document.getElementsByTagName('h1').length-1].textContent.trim(); | |
const ticketUrl = `${location.origin}/browse/${ticketNumber}`; | |
const html = `<a href="${ticketUrl}">${ticketNumber} [${ticketSummary}]</a>`; | |
const text = `[${ticketNumber} ${ticketSummary}](${ticketUrl})`; |
asd \
asd`
asd `` asd
asd ` asd
This file contains 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
diff --git a/.gitignore b/.gitignore | |
index fc00ed5..ac82bec 100644 | |
--- a/.gitignore | |
+++ b/.gitignore | |
@@ -5,6 +5,7 @@ web/core | |
web/modules/contrib | |
web/themes/contrib | |
web/profiles/contrib | |
+web/libraries | |
This file contains 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
Target: custom entity type, not config entity, nor content entity | |
# implementation 1: | |
- entity: EntityInterface | |
- storage: EntityStorageInterface | |
- query service: | |
- QueryFactoryInterface | |
- QueryInterface | |
- ConditionInterface | |
# implementation 2: |
This file contains 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
#!/usr/bin/php | |
<?php | |
$input = file_get_contents('php://stdin'); | |
preg_match('|^To: (.*)|', $input, $matches); | |
$t = '/Users/alex/outgoing_mails/' . date('Y-m-d_H-i-s') . '---' . $matches[1] . '---' . uniqid() . '.eml'; | |
file_put_contents($t, $input); | |
chmod($t, 0666); |
This file contains 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
solution: https://drupal.org/node/1145076#comment-7673535 |
This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains 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
Task(this.timeTracker, [this.name = '', this.seconds = 0]) { | |
// copy task from template | |
taskDiv = document.query('#task-template').clone(true); | |
taskDiv.attributes.remove('id'); | |
// init inputs | |
nameInput = taskDiv.query('.name'); | |
timeInput = taskDiv.query('.time'); | |
nameInput.value = name; | |
timeInput.value = formatTimeString(seconds); |