Skip to content

Instantly share code, notes, and snippets.

View cb109's full-sized avatar
💭
🍴 🐘

Christoph Bülter cb109

💭
🍴 🐘
View GitHub Profile
@lucaswxp
lucaswxp / Check field exists in model django snippet.md
Last active March 22, 2024 07:53
Check field exists in model django snippet

In your models.py put:

from django.db import models

@classmethod
def model_field_exists(cls, field):
    try:
        cls._meta.get_field(field)
 return True
@thom-nic
thom-nic / build.gradle
Last active November 16, 2023 07:35
find the largest classnames in Spring libraries. Also find FactoryFactories
/**
* Find the longest class names in Spring.
* Also find FactoryFactory classes.
* a goof-off project by @thom_nic
*/
import java.util.jar.*
defaultTasks 'longest', 'factoryfactory'
@dbr
dbr / nuke_dot_arrange.py
Created October 1, 2011 08:44
Using graphviz's "dot" to arrange a Nuke node graph
"""Test of using graphviz's "dot" layout algorithm to arrange a Nuke node-graph
Example: http://i.imgur.com/f1mK7.png
Left is dot, right is Nuke's builtin nuke.autoplace
"""
import nuke
# http://code.google.com/p/pydot/
import pydot