import $$ from '$$'
$$('p').forEach(a => a.innerText = "yolo")
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Replaces an entire directory of symlinked files with their originals. | |
# | |
find -L $1 -xtype l -exec bash -c 'cp --remove-destination "$(readlink -f "{}")" "{}"' \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
include_once('autoload.php'); | |
ini_set("memory_limit", "-1"); | |
ini_set("date.timezone", "Europe/London"); | |
$cli =& eZCLI::instance(); | |
$script =& eZScript::instance(); | |
$script->startup(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "inspircd.h" | |
/** | |
* m_gender_pronouns.cpp | |
* Introduces two new commands, SETGENDER and SETPRONOUN, | |
* allowing a user to specify their gender identity and | |
* preferred gender pronouns. | |
* | |
* Copyright (c) 2017 Alex Wilson <a@ax.gy> | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const SITEMAP_CACHE_KEY = 'sitemap-cached-pages-v1' | |
self.addEventListener('install', event => { | |
event.waitUntil(cacheSitemap()) | |
}) | |
const cacheSitemap = _ => caches.open(SITEMAP_CACHE_KEY) | |
.then(cache => | |
cacheSitemap() | |
.then(urls => urls.map(u => u.toString())) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Reduce a list by cancelling pairs of values. | |
// e.g. cancelByPair('LLLRLRLRLR', 'L', 'R') === 'LL' | |
function cancelByPair(list, firstValue, secondValue) { | |
// First filter out all of these values, and count them as we go. | |
let count = 0; | |
const cancelledList = list.filter(c => { | |
switch (c) { | |
case firstValue: | |
count++ |
I hereby claim:
- I am antoligy on github.
- I am antoligy (https://keybase.io/antoligy) on keybase.
- I have a public key whose fingerprint is B5E9 8AE7 DDB8 B82E B375 E2CF DE20 36C6 B4D2 F38E
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Why does syntax highlighting need this? | |
use eZ\Publish\Core\MVC\Symfony\Security\User as EzUser; | |
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; | |
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Component\HttpFoundation\Session\Session; | |
$securityContext = $container->get('security.context'); | |
$router = $container->get('router'); | |
$requestStack = $container->get('request_stack'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Sass import for generating nestable containers. | |
* The "rest" of the grid is just flex boxes. | |
*/ | |
*, :after, :before { | |
box-sizing: inherit; | |
} | |
html, body { | |
padding: 0; | |
margin: 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace EzPublish\AppBundle\EventListener; | |
use eZ\Publish\Core\MVC\Legacy\Event\PreBuildKernelEvent; | |
use eZ\Publish\Core\MVC\Legacy\LegacyEvents; | |
use Symfony\Component\EventDispatcher\EventSubscriberInterface; | |
class LegacyConfigurationMapper implements EventSubscriberInterface | |
{ | |
/** |