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 / Gemfile
Last active November 12, 2022 23:24
Batch update labels in Github repos
gem "octokit", "~> 4.0"
@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 / list_gitorious_repos.py
Last active October 18, 2019 07:38
Python script to list all repos for gitorious projects. Since this feature is not available through the UI, we need to use the provided XML data as a start to aggregate these results. Requires Python 3. Example usage: python3.3 list_gitorious_repos.py -u myuser@test.com -p mypassword --repo cms http://gitorious.silverstripe.com
import argparse
import xml.etree.ElementTree as ET
import urllib.request
import base64
import json
import os.path
import re
class GitoriousRepoLister:
"""
@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 / Fakesub.php
Last active December 31, 2015 21:49
<?php
class MyFakeObject extends FakeObject{
public function getSchema() {
return array(
'id' => null,
'personalDetails' => new FakeObject(array(
'firstName' => null,
'lastName' => null
))