Skip to content

Instantly share code, notes, and snippets.

View chillu's full-sized avatar
👋

Ingo Schommer chillu

👋
View GitHub Profile
<html>
<head>
<script type="text/javascript" src="/script.js"></script>
</head>
<body>
<p>Internal nav</p>
<ul>
<li><a href="/index.html">Home without UTM</a></li>
<li><a href="/blog/my-blog-post.html">Blog post without UTM</a></li>
<li><a href="/other-page.html">Other page without UTM</a></li>
@chillu
chillu / 0_community.sql
Last active October 13, 2021 05:38
Silverstripe CMS Community Health Metrics - BigQuery SQL
# This query is scheduled to run every 24 hours within Google BigQuery,
# appending data to the 'community' table. It has sourced the repos
# from addons.silverstripe.org in a one-off export mid 2021.
# TODO Newly created Silverstripe packages are "auto-discovered" by addons.silverstripe.org,
# but they're not automatically added to the scheduled query.
SELECT
id,
type,
created_at,
repo.name AS repo_name,
@chillu
chillu / PaginatedFileMigrationHelper.php
Last active September 3, 2019 23:36
SS 4.x file migration performance tips
<?php
use Generator;
use LogicException;
use Psr\Log\LoggerInterface;
use SilverStripe\Assets\Dev\Tasks\FileMigrationHelper;
use SilverStripe\Assets\File;
use SilverStripe\Assets\FilenameParsing\FileIDHelperResolutionStrategy;
use SilverStripe\Assets\FilenameParsing\FileResolutionStrategy;
use SilverStripe\Assets\FilenameParsing\LegacyFileIDHelper;
use SilverStripe\Assets\Flysystem\FlysystemAssetStore;
@chillu
chillu / AriaAttributes.ss
Last active March 21, 2019 02:31
Design System Brainstorm
<!-- See https://github.com/silverstripe/cwp-starter-theme/blob/master/templates/Includes/AriaAttributes.ss -->
<% if $Message || $Description %>
aria-describedby="<% if $Message %>message-$ID<% end_if %><% if $Description %><% if $Message %> <% end_if %>describes-$ID<% end_if %>"
<% end_if %>
<% if $Title || $RightTitle %>
aria-labelledby="<% if $Title %>title-$ID<% end_if %><% if $RightTitle %><% if $Title %> <% end_if %>extra-label-$ID<% end_if %>"
<% end_if %>
@chillu
chillu / index.php
Created February 18, 2019 05:22
graphql-interface-types-poc
<?php
// See http://webonyx.github.io/graphql-php/getting-started/ on how to run this
require_once('vendor/autoload.php');
use GraphQL\Type\Definition\InterfaceType;
use GraphQL\Type\Definition\ObjectType;
use GraphQL\Type\Definition\Type;
use GraphQL\GraphQL;
use GraphQL\Type\Definition\UnionType;
ID Created Comment
1 2019-01-01 12:30:00 Modify A1>B1>C1
2 2019-01-01 12:31:00 Modify A1>B2>C2
3 2019-01-01 12:31:01 Publish A1>B2>C2
4 2019-01-01 12:32:00 Add A1>B2>C3
5 2019-01-01 12:33:00 Publish A1
6 2019-01-01 12:34:00 Delete A1>B2>C3
7 2019-01-01 12:35:00 Publish A1
@chillu
chillu / Gemfile
Last active November 12, 2022 23:24
Batch update labels in Github repos
gem "octokit", "~> 4.0"
@chillu
chillu / test
Last active October 19, 2015 22:23
https://docs.google.com/a/silverstripe.com/spreadsheets/d/1wCVYnP95QDT7PLAb7iV2xiSuB9QUGMsYkfhQ6Lamdq0/pubhtml?gid=571311456&single=true
@chillu
chillu / gist:93eb5e8191b257bb24b6
Created June 8, 2015 06:06
RFC: Retiring and replacing the web test runner

The core team recently voted in favour of retiring the current web test runner (TestRunner) (accessible via dev/tests).

The current web test runner functions differently to the sake/phpunit test runners, is susceptible to superglobal leakage, and is basically a bit of a pain to maintain because of the difference in running environments. Also, it's extra code weight and attack surface for live environments when it should really be a dev dependency.

This RFC suggests it is replaced with a module that:

  • functions as a web wrapper to call the test runner via the phpunit binary
  • with a listener feeding back to the UI via WebSocket.
  • would run only in dev mode
  • strongly discourage being loaded as anything but a dev dependency