Skip to content

Instantly share code, notes, and snippets.

View thet's full-sized avatar

Johannes Raggam thet

View GitHub Profile
@ScriptedAlchemy
ScriptedAlchemy / getOrLoadRemote.js
Last active February 14, 2024 02:25
The Right Way to Load Dynamic Remotes
import { injectScript } from '@module-federation/utilities';
// example of dynamic remote import on server and client
const isServer = typeof window === 'undefined';
//could also use
// getModule({
// remoteContainer: {
// global: 'app2',
// url: 'http://localhost:3002/remoteEntry.js',
// },
// modulePath: './sample'
/* globals define */
define(function(){
'use strict';
var REGISTERED = {};
var register = function(name, config){
REGISTERED[name] = config;
};
@fulv
fulv / case-insensitive.py
Created November 18, 2015 23:59
herding cats
from Products.Archetypes.annotations import AT_ANN_STORAGE
from Products.Archetypes.annotations import AT_FIELD_MD
from Products.Archetypes.annotations import AT_MD_STORAGE
from Products.Archetypes.annotations import AT_REF
from Products.Archetypes.annotations import getAnnotation
from Products.Archetypes.ArchetypeTool import listTypes
from Products.Archetypes.ArchetypeTool import process_types
from Products.Archetypes.ArchetypeTool import registerClasses
from Products.Archetypes.ArchetypeTool import registerType
@Daenyth
Daenyth / debug_requests.py
Created August 27, 2015 14:35
Enable debug logging for python requests
import requests
import logging
import httplib
# Debug logging
httplib.HTTPConnection.debuglevel = 1
logging.basicConfig()
logging.getLogger().setLevel(logging.DEBUG)
req_log = logging.getLogger('requests.packages.urllib3')
req_log.setLevel(logging.DEBUG)