#test
This file contains 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
""" | |
This overrides some of the default behaviour of richtext from Wagtail | |
""" | |
from wagtail.wagtailcore.rich_text import get_link_handler, extract_attrs, get_embed_handler, LINK_HANDLERS, FIND_A_TAG, FIND_EMBED_TAG | |
from wagtail.wagtailcore.rich_text import PageLinkHandler as OriginalPageLinkHandler | |
from wagtail.wagtailcore.models import Page | |
from django.utils.html import escape |
This file contains 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#include <unistd.h> | |
/* | |
Malloc memory of argv sizes with an interval of 10ms in between. | |
*/ | |
int main(int argc, char **argv) |
This file contains 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
#!/bin/bash | |
# (expiration is in days) | |
BACKUP_SRC=/home/manos | |
BACKUP_DEST=/media/manos/Backup | |
BACKUP_PREFIX=backup- | |
BACKUP_EXPIRY=365 | |
# Remove old backups |
This file contains 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
''' | |
A generic tracing class that can be used to trace packages. | |
This can be very helpful for trying to understand the flow | |
of a program or a package. | |
Usage: | |
tracer = Tracer() | |
tracer.watch_package('pyOCD') | |
sys.settrace(tracer.trace) |
This file contains 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
def find_cmd_abspath(cmd): | |
""" Returns the absolute path to a command. | |
None is returned if no absolute path was found. | |
""" | |
if exists(cmd) or exists(cmd + '.exe'): | |
return os.path.abspath(cmd) | |
if not 'PATH' in os.environ: | |
raise Exception("Can't find command path for current platform ('%s')" % sys.platform) | |
PATH = os.environ['PATH'] | |
for path in PATH.split(os.path.pathsep): |