Software | PHP | Composer | Drush | Symfony | Twig | Node.js | Drupal |
---|---|---|---|---|---|---|---|
Drupal 7.x | 5.4+ | 1.x | 6+ | 2.8 - 3.x | 1+ | 4+ | |
Drupal 8.x | 7.0+ | 1.x | 8+ | 3.4 - 4.x | 1+ | 4+ | |
Drupal 9.x | 7.3+ | 2.x | 10+ | 4.4 - 5.x | 2+ | 8+ | |
Drupal 10.x | 8.0+ | 2.x | 10+ | 5.x | 2+ | 12+ | |
Open Social 10.x | 7.0+ | 8.8 - 9.1 | |||||
Open Social 11.x | 7.4 - 8.x | 9.x | |||||
Open Social 12.x | 8.1+ | 10.2.x | |||||
NextJS 12.x |
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
<?php | |
/** | |
* First enable translation tracking (if it's disabled) by removing `collections.language.*` | |
* from /admin/config/development/configuration/ignore. | |
* After that, export all field translation .po files from the drupal7 site and save them | |
* in a directory in your project. | |
* The way the script is made requires some specifications: | |
* -The dir that the .po files are stored (e.g. /path/to/poFiles) | |
* -The dir that contains the language files (e.g. /path/to/config/sync/languages/) | |
* -The entities you want the translations from |
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
<?php | |
namespace Drupal\my_module\Commands; | |
use Drush\Commands\DrushCommands; | |
use Drupal\Core\KeyValueStore\KeyValueFactoryInterface; | |
/** | |
* A Drush commandfile. | |
* |
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
<?php | |
// in src/Form directory. | |
namespace Drupal\mymodule\Form; | |
use Drupal\Core\Form\FormStateInterface; | |
use Drupal\system\Form\SiteInformationForm; | |
/** |
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
/** | |
* Works in Next.js 10.x | |
*/ | |
import React from 'react' | |
import parse, { | |
domToReact, | |
attributesToProps, | |
Element, | |
HTMLReactParserOptions, | |
} from 'html-react-parser' |
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
exports.config = { | |
externals: [ 'next' ], | |
optimization: { | |
noEmitOnErrors: false, | |
checkWasmTypes: false, | |
nodeEnv: false, | |
splitChunks: { | |
chunks: 'all', | |
cacheGroups: [Object], | |
maxInitialRequests: 25, |
Profile | download (kb/s) | upload (kb/s) | latency (ms) |
---|---|---|---|
Native | 0 | 0 | 0 |
GPRS | 50 | 20 | 500 |
56K Dial-up | 50 | 30 | 120 |
Mobile EDGE | 240 | 200 | 840 |
2G Regular | 250 | 50 | 300 |
2G Good | 450 | 150 | 150 |
3G Slow | 780 | 330 | 200 |
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
import React from "react"; | |
import { NextPageContext } from "next"; | |
const blogPostsRssXml = (blogPosts: IBlogPost[]) => { | |
let latestPostDate: string = ""; | |
let rssItemsXml = ""; | |
blogPosts.forEach(post => { | |
const postDate = Date.parse(post.createdAt); | |
if (!latestPostDate || postDate > Date.parse(latestPostDate)) { | |
latestPostDate = post.createdAt; |
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
// create a bookmark and use this code as the URL, you can now toggle the css on/off | |
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3 | |
javascript: (function() { | |
var styleEl = document.getElementById('css-layout-hack'); | |
if (styleEl) { | |
styleEl.remove(); | |
return; | |
} | |
styleEl = document.createElement('style'); | |
styleEl.id = 'css-layout-hack'; |
NewerOlder