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
#!/usr/bin/env sh | |
rx='(FMPLF)(.*)' | |
for f in FMPLF_SC_* | |
do | |
[[ "$f" =~ $rx ]] | |
new_f="${BASH_REMATCH[1]}_D${BASH_REMATCH[2]}" | |
echo "mv $f with $new_f" | |
git mv $f $new_f |
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
import sys | |
import trace | |
tracer = trace.Trace( | |
ignoredirs=[ | |
'/usr/local/lib/python3.6', # adapt to your environment. | |
'/path/to/lib/python3.6/site-packages', | |
], | |
trace=1, | |
count=0, |
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
def rmtree_ftp(ftp, path): | |
"""Recursively delete a directory tree on a remote server.""" | |
wd = ftp.pwd() | |
try: | |
names = ftp.nlst(path) | |
except ftplib.all_errors as e: | |
# some FTP servers complain when you try and list non-existent paths | |
#_log.debug('FtpRmTree: Could not remove {0}: {1}'.format(path, e)) | |
return |
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
# -*- coding: utf-8 -*- | |
from django.db import models | |
from django.contrib import admin | |
from django.core import serializers | |
from django.http import HttpResponse | |
class ModelAdmin(admin.ModelAdmin): | |
actions = ["dumpdata"] |
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
# -*- coding: utf-8 -*- | |
""" | |
Example Usage | |
============= | |
>>> import datetime | |
>>> start = datetime.date(2009, 6, 21) |