Skip to content

Instantly share code, notes, and snippets.

View Natshah's full-sized avatar
💻
Automating the Automated

Rajab Natshah Natshah

💻
Automating the Automated
View GitHub Profile
<?php
define('START', 0);
define('END', 948);
$output_handle = fopen('./projects.csv', 'w');
fputcsv($output_handle, [
'category',
'development status',
'maintained',
'body',
@tienthanh2509
tienthanh2509 / install-openvpn-24.sh
Last active November 22, 2021 12:29
Install OpenVPN 2.4.x on Ubuntu 16.04 Xenial
curl -s https://swupdate.openvpn.net/repos/repo-public.gpg | apt-key add -
echo "deb http://build.openvpn.net/debian/openvpn/stable xenial main" > /etc/apt/sources.list.d/openvpn-aptrepo.list
apt update
apt install -y openvpn
@waako
waako / .csscomb.json
Created January 19, 2017 15:51
Gulp workflow for Drupal 8 theme. Includes csscomb for Drupal CSS Code Standards and Sass Lint
{
"exclude": [
".git/**",
"misc/**",
"modules/**",
"profiles/**",
"themes/**",
"node_modules/**",
"bower_components/**"
],
@crittermike
crittermike / ExampleModuleController.php
Last active June 17, 2021 12:55
Example of overriding a route controller in Drupal 8
<?php
/**
* @file
* Contains \Drupal\example_module\Controller\ExampleModuleController.
*/
// THIS FILE BELONGS AT /example_module/src/Controller/ExampleModuleController.php
namespace Drupal\example_module\Controller;
id: example_content
label: Example content
migration_group: example
source:
plugin: example_content
target: db_migration
destination:
plugin: entity:node
process:
type:
<?php
/**
* @file
* Contains \Drupal\example_migrate\Plugin\migrate\source\ExampleContent.
*/
namespace Drupal\example_migrate\Plugin\migrate\source;
use Drupal\migrate\Plugin\migrate\source\SqlBase;
@omerida
omerida / om_exporter.drush.inc
Last active October 14, 2015 16:49
Export Drupal Nodes to CSV with EntityFieldQuery and PHP 5
<?php
function om_exporter_drush_command() {
$items['export-newest'] = array(
'description' => 'Export Newest Content to CSV',
'aliases' => ['ex-new'],
'callback' => 'om_export_newest',
'arguments' => [
'date' => '',
]
@jonathanfranks
jonathanfranks / FormContext.php
Created August 12, 2015 15:05
Behat CKEditor
/**
* @Then /^I fill in wysiwyg field "([^"]*)" with "([^"]*)"$/
*/
public function iFillInWysiwygOnFieldWith($locator, $value) {
$el = $this->getSession()->getPage()->findField($locator);
$fieldId = $el->getAttribute('id');
if (empty($fieldId)) {
throw new Exception('Could not find an id for field with locator: ' . $locator);
}
{
"name": "mynamespace/myproject",
"description": "Composer file example",
"repositories": [
{
"type": "composer",
"url": "http://drupal-packagist.webflo.io/"
},
{
"type": "package",
{
"name": "mynamespace/myproject",
"description": "Example composer file with provides",
"repositories": [
{
"type": "composer",
"url": "http://drupal-packagist.webflo.io/"
},
{
"type": "package",