stopBefore(document, 'getElementById')
stopBefore('document.getElementById') // the same as the previous
stopBefore(Element.prototype, 'removeChild')
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ViewManager(models.Manager): | |
| def bulk_create(self, *args, **kwargs): | |
| raise NotImplementedError | |
| def create(self, *args, **kwargs): | |
| raise NotImplementedError | |
| def get_or_create(self, *args, **kwargs): | |
| raise NotImplementedError |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html ng-app="Demo" ng-controller="DemoController"> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <title>Rendering DOM Elements With ngRepeat In AngularJS</title> | |
| </head> | |
| <body> | |
| <h1> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| LOGGING = { | |
| 'version': 1, | |
| 'disable_existing_loggers': False, | |
| 'filters': { | |
| 'require_debug_false': { | |
| '()': 'django.utils.log.RequireDebugFalse' | |
| } | |
| }, | |
| 'formatters':{ | |
| 'simple': { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from cProfile import Profile | |
| from django.core.management.base import BaseCommand | |
| class ProfileEnabledBaseCommand(BaseCommand): | |
| """Enable profiling a command with --profile. | |
| Requires child class to define _handle instead of handle. | |
| via https://gist.github.com/dfrankow | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (println (clojure.string/join "\n" (seq (.getURLs (java.lang.ClassLoader/getSystemClassLoader))))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.ComponentModel; | |
| using System.ComponentModel.Composition; | |
| using System.Deployment.Application; | |
| using System.Globalization; | |
| using System.Linq; | |
| using System.Reactive.Linq; | |
| using System.Timers; | |
| using System.Windows; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| LINK_DETECTION_REGEX = /(([a-z]+:\/\/)?(([a-z0-9\-]+\.)+([a-z]{2}|aero|arpa|biz|com|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|pro|travel|local|internal))(:[0-9]{1,5})?(\/[a-z0-9_\-\.~]+)*(\/([a-z0-9_\-\.]*)(\?[a-z0-9+_\-\.%=&]*)?)?(#[a-zA-Z0-9!$&'()*+.=-_~:@/?]*)?)(\s+|$)/gi | |
| EMOJI_DIRECTORY = "/path/to/assets/emoji/20x20" | |
| # Handlebars is presumed, but you could swap out | |
| ESCAPE_EXPRESSION_FUNCTION = Handlebars.Utils.escapeExpression | |
| MARKSAFE_FUNCTION = (str) -> new Handlebars.SafeString(str) | |
| # Emoji unicode chars become images. |