Skip to content

Instantly share code, notes, and snippets.

View chriscdn's full-sized avatar

Christopher Meyer chriscdn

View GitHub Profile
@chriscdn
chriscdn / put_as_create.py
Created November 12, 2015 14:37 — forked from tomchristie/put_as_create.py
PUT-as-create mixin class for Django REST framework.
class AllowPUTAsCreateMixin(object):
"""
The following mixin class may be used in order to support PUT-as-create
behavior for incoming requests.
"""
def update(self, request, *args, **kwargs):
partial = kwargs.pop('partial', False)
instance = self.get_object_or_none()
serializer = self.get_serializer(instance, data=request.data, partial=partial)
serializer.is_valid(raise_exception=True)
@chriscdn
chriscdn / CLLocation+rhextensions.h
Last active August 17, 2018 07:23
A CLLocation category for determing the time zone from a location.
//
// CLLocation+rhextensions.h
//
// Copyright (C) 2015 by Christopher Meyer
// http://schwiiz.org/
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@chriscdn
chriscdn / CS10.0 Logout Link
Created October 16, 2014 13:24
In later versions of CS10.0 a secure token is required for logout. This snippet can be placed in the appearance header to extract the logout link and execute it.
@chriscdn
chriscdn / super.lxe
Last active August 29, 2015 14:06
A function for making super calls in OpenText Content Server OScript.
/**
* Christopher Meyer [email protected]
* Copyright 2014 Red House Consulting GmbH
*
* Version: 1.3
*/
function Dynamic super(Object item, String func)
switch GetMethodType(item, func)
@chriscdn
chriscdn / beautify_oscript.lxe
Last active September 2, 2018 00:15
beautify_oscript.lxe - A code beautifier for OpenText Content Server OScript
/**
* beautify_oscript.lxe - A code beautifier for OpenText Content Server OScript
*
* This script will beautify your OScript. Copy to a file within opentext/scripts/
* (e.g., opentext/scripts/beautify_oscript.lxe), restart Builder, place the focus on a
* script window, and run from the Tools menu.
*
* Some coding conventions assumed. Use at your own risk.
*
* Christopher Meyer ([email protected])