Skip to content

Instantly share code, notes, and snippets.

View bufke's full-sized avatar

David Burke bufke

View GitHub Profile
@bennadel
bennadel / a-view.component.ts
Created January 12, 2018 13:30
Creating A Jump-To-Anchor Fragment Polyfill In Angular 5.2.0
// Import the core angular services.
import { Component } from "@angular/core";
// ----------------------------------------------------------------------------------- //
// ----------------------------------------------------------------------------------- //
@Component({
selector: "a-view",
styleUrls: [ "./a-view.component.less" ],
template:
@KostyaEsmukov
KostyaEsmukov / _ express-redirect-platform-location.md
Last active October 20, 2023 20:55
HTTP redirects with Angular SSR

HTTP redirects with Angular Server Side Rendering

This service assumes that you followed the SSR receipt at ng-cli (i.e. you use the '@nguniversal/express-engine' package).

@pardo
pardo / debounced_celery_task.py
Last active September 8, 2023 08:04
Debounced celery task in python
def debounced_wrap(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
key = kwargs.pop("key") # it's required
call_count = kwargs.pop("call_count", 1)
count = cache.get(key, 1)
if count > call_count:
# someone called the function again before the this was executed
return None
# I'm the last call
@JedWatson
JedWatson / notes.md
Last active February 20, 2020 13:01
Notes on how to create a new field type for Keystone

Creating new Field Types for KeystoneJS

We're currently working on making it easier to add new field types to KeystoneJS as plugins.

In the meantime, if you'd like to work on your own field type, hopefully this guide will point you in the right direction.

Keystone fields require the following:

  • a {fieldType}.js file in ./lib/fieldTypes that controls the field and encapsulates options support, underscore functions, validation and updating
  • the {fieldType}.js file needs to be included by ./lib/fieldTypes/index.js