Skip to content

Instantly share code, notes, and snippets.

@wimleers
wimleers / dcon-vienna-api-first.md
Last active September 25, 2017 07:56 — forked from e0ipso/api-first-priorities.md
DrupalCon Vienna API-First Sprints
$ ping google.com
PING google.com (216.58.211.110): 56 data bytes
64 bytes from 216.58.211.110: icmp_seq=0 ttl=53 time=19.736 ms
64 bytes from 216.58.211.110: icmp_seq=1 ttl=53 time=21.182 ms
64 bytes from 216.58.211.110: icmp_seq=2 ttl=53 time=91.430 ms
64 bytes from 216.58.211.110: icmp_seq=3 ttl=53 time=21.584 ms
Request timeout for icmp_seq 4
Request timeout for icmp_seq 5
Request timeout for icmp_seq 6
Request timeout for icmp_seq 7
@wimleers
wimleers / gist:750179
Created December 21, 2010 16:37
Wait for input by the user on stdin — the Qt way (and thus cross-platform).
QTextStream in(stdin);
forever {
QString line = in.readLine();
if (!line.isNull())
break;
}
@wimleers
wimleers / .htaccess
Created November 15, 2011 06:37
.htaccess file to only allow downloads from Amazon CloudFront.
Options +FollowSymLinks -MultiViews
RewriteEngine On
SetEnvIf User-Agent ^Amazon Cloudfront$ cdn
Order Deny,Allow
Deny from all
Allow from env=cdn
@wimleers
wimleers / sphp.sh
Created October 17, 2016 11:37 — forked from w00fz/sphp.sh
PHP switcher
#!/bin/bash
# Check if command was ran as root.
if [[ $(id -u) -eq 0 ]]; then
echo "The command \"sphp\" should not be executed as root or via sudo directly."
echo "When a service requires root access, you will be prompted for a password as needed."
exit 1
fi
# Usage
HTTP/1.1 200 OK
Accept-Ranges: bytes
Age: 96
Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0
Connection: keep-alive
Content-Encoding: gzip
Content-Length: 26
Content-Security-Policy: frame-ancestors 'self'
Content-Type: text/html; charset=utf-8
Date: Sat, 13 Feb 2016 11:06:49 GMT
+--------------------------+ extends +-----------------------+ implements +------------------+
+--------------------------------->| AssetCollectionInterface +---------->| AsseticAssetInterface |<------------ + AsseticBaseAsset |
ASSETIC | +--------------------------+ +-----------------------+ +------------------+
| ^ ^
+-----------------------------|---------------------------------------------------------------------------------------------|-------------------------|-----------------------------+
+-----------------------------|---------------------------------------------------------------------------------------------|-------------------------|-----------------------------+
@wimleers
wimleers / rsync.net-backup-stats.py
Created August 8, 2013 22:37
Retrieves the quota details of the given SSH hots and outputs JSON. Tested with http://rsync.net.
#!/usr/bin/env python
# Retrieves the quota details of the given SSH hots and outputs JSON.
import os
import optparse
import subprocess
def calculate(hosts):
records = {}
@wimleers
wimleers / edit_ds.patch
Created August 5, 2013 13:16
After talking with @aspilicious, it seems this is what is necessary to support Display Suite in Drupal 8. Whenever Display Suite is used to render a "real field" differently, then `#field_name` should still be set. Whenever it is used to render a "pseudo field", then `#field_name` should not be set. Then no corresponding `data-edit-id` attribute…
core/modules/edit/edit.module | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/core/modules/edit/edit.module b/core/modules/edit/edit.module
index a7fbb5d..a174e4e 100644
--- a/core/modules/edit/edit.module
+++ b/core/modules/edit/edit.module
@@ -162,6 +162,11 @@ function edit_field_formatter_info_alter(&$info) {
* Implements hook_preprocess_HOOK() for field.tpl.php.
*/
diff --git a/core/modules/edit/js/util.js b/core/modules/edit/js/util.js
index 3f2919e..02ad49e 100644
--- a/core/modules/edit/js/util.js
+++ b/core/modules/edit/js/util.js
@@ -62,13 +62,17 @@ Drupal.edit.util.form = {
url: Drupal.edit.util.buildUrl(fieldID, drupalSettings.edit.fieldFormURL),
event: 'edit-internal.edit',
submit: { nocssjs : options.nocssjs, reset : options.reset },
- progress: { type : null } // No progress indicator.
+ progress: { type : null }, // No progress indicator.