Skip to content

Instantly share code, notes, and snippets.

View zytzagoo's full-sized avatar

zytzagoo zytzagoo

View GitHub Profile
@vdbelt
vdbelt / cloudflare-purge-cache-service-worker.js
Created August 21, 2018 11:43
A CloudFlare service worker that proxies purge cache requests. Example: https://example.com/__purge_cache?zone=XX
addEventListener('fetch', event => {
event.respondWith(purgeCache(event.request))
})
async function purgeCache(request) {
const url = new URL(request.url)
@zytzagoo
zytzagoo / mina.rb
Last active April 4, 2016 13:54
Modified/patched lib/mina.rb (0.3.2) for Windows support
# lib/mina.rb
module Mina
PREFIX = File.dirname(__FILE__)
ROOT = File.expand_path('../../', __FILE__)
# if running on windows
is_windows = !!(RUBY_PLATFORM =~ /mswin|mingw|windows|cygwin/)
if is_windows
module Shellwords
@beporter
beporter / composer-create-project-test.sh
Last active January 9, 2020 20:28
Make the process of testing a `composer create-project` command easier by operating against your local working copy.
#!/usr/bin/env bash
# Allows you to test the create-project process using your local
# checked-out copy of the skeleton as the source. You MUST commit the
# changes you want to test to a git branch! You MUST name that branch
# as the first argument and the destination path to set up the fresh
# copy into as the second.
#
# Usage:
# - Place this script in your package's root directory and make it executable.
# - Set the PACKAGE_NAME variable below to match your composer.json's `name`.