Skip to content

Instantly share code, notes, and snippets.

View andybroomfield's full-sized avatar

Andy Broomfield andybroomfield

View GitHub Profile
@arunchinnachamy
arunchinnachamy / solrconfig.xml
Created April 5, 2013 09:48
Default SOLR Configuration file solrconfig.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@arunchinnachamy
arunchinnachamy / schema.xml
Last active October 16, 2020 12:09
Default schema.xml for tutorials in http://www.installationpage.com. Look in the comments for the link.
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
<?php
//
// delete-old-tweets.php - https://github.com/timdp
//
// -- Instructions --
// 1. Save this script somewhere as delete-old-tweets.php
// 2. Get your Twitter archive and extract it to the same folder
// 3. Clone https://github.com/themattharris/tmhOAuth to the same folder
// 4. Register an app at dev.twitter.com and enter its credentials below
@arturotena
arturotena / TrimJavaScriptPolyfill.js
Last active January 7, 2021 15:07
JavaScript trim() polyfill
/* trim ployfill: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim */
if (!String.prototype.trim) {
(function() {
// Make sure we trim BOM and NBSP
var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
String.prototype.trim = function() {
return this.replace(rtrim, '');
};
})();
}
@dpagini
dpagini / clear_varnish.sh
Created September 21, 2017 19:19
Acquia cloud hook function to clear varnish cache.
#!/bin/bash
varnish_purge() {
echo "@INFO: Clear varnish cache starting"
for domain in `$drush_cmd ac-domain-list --format=print_r`; do
echo "@INFO: Clearing varnish cache for $domain"
$drush_cmd ac-domain-purge $domain
done
Problem:
--------
Trying to get a test to use a custom handler, defaultConfiguration()
in QuizFormHandler references a configuration setting called 'training_program'.
In order for this to work properly during install, Drupal needs to know the schema
of any handlers that have configuration settings
Webform missing schema error
----------------------------
Drupal\Core\Config\Schema\SchemaIncompleteException :
@nathanhleung
nathanhleung / FIX-MACOS-HANG.md
Last active December 17, 2024 09:03
Fix macOS Hanging Issue

Fix macOS Hanging Issue

Problem

Hey Apple users:

If you're now experiencing hangs launching apps on the Mac, I figured out the problem using Little Snitch.

It's trustd connecting to http://ocsp.apple.com >

@varjmes
varjmes / calm.js
Created March 25, 2021 22:39
Calm Mode Bookmarklet
javascript:(function () { const page = document.getElementsByTagName('html'); page[0].style.filter = 'saturate(50%)'})();
@jenitehan
jenitehan / MyModuleRouteSubscriber.php
Created February 3, 2022 19:44
Set Drupal group parameter on a views page route with a group ID contextual filter.
<?php
namespace Drupal\my_module\EventSubscriber;
use Drupal\Core\Routing\RouteSubscriberBase;
use Drupal\Core\Routing\RoutingEvents;
use Symfony\Component\Routing\RouteCollection;
/**
* My module route subscriber.
@lucahammer
lucahammer / delete-tweets.js
Last active July 14, 2026 02:01
Delete all your Tweets Javascript
/*
This may get your account banned. It runs in your regular browser with your regular login without needing the API.
The script does the same things that you would do yourself:
Click the three dots, select delete Tweet, confirm, scroll to next Tweet, repeat.
==========================
Usage
1. Open your Twitter profile in a browser
2. Open the console in the developer tools (F12)
3. Paste the script and press enter
4. ???