Skip to content

Instantly share code, notes, and snippets.

View aquinzi's full-sized avatar

Ariela Quinzi aquinzi

View GitHub Profile
@aquinzi
aquinzi / nikola_translated.py
Created January 11, 2014 21:32
Delete duplicated nikola meta data in translated posts (must be in nikola's translated paths)
# Delete duplicated nikola meta data in translated posts (must be in nikola's translated paths)
import os, sys, codecs
import shutil
# recursive, paths from working dir
FROM_PATH = ""
OUTPUT_PATH = None #if none, replace file
def file_open_save(path, mode, text=False):
@aquinzi
aquinzi / pelican_nikola_metablocks.py
Created January 11, 2014 21:25
Converts multimarkdown meta block (pelican) to nikola's; also moves "draft" status and summary
# Converts multimarkdown meta block (pelican) to rst (nikola); also moves "draft" status and summary
#
import os, sys, codecs
# recursive, paths from working dir
FROM_PATH = ""
OUTPUT_PATH = None #if none, replace file
SUMMARY_TO_DESCRIPTION = True # Put summary key (pelican) to description key (nikola)
@aquinzi
aquinzi / sitemap_generator.py
Created December 16, 2013 23:28
Creates a simple sitemap
"""
Creates a simple sitemap, taking a source dir and translating to a site url; applying filters:
PATH_SITE: source path, must include / at the end ; also accesible from cli with -f
SITE_URL: must include final /; also accesible from cli with -s
EXTENSIONS_ACCEPTED: ('ext1', 'ext2')
SITEMAP_FILE: also accesible from cli with -xml
IGNORE_FILES: ('error.php', '.htaccess')
IGNORE_FOLDERS: ('.svn', 'imgs', 'src')
PRIORITY: from 0.0 to 1.0; also accesible from cli with -p
@aquinzi
aquinzi / svnlog.py
Last active December 29, 2015 22:09
Create svn changelog
# Create svn changelog (Python 2.7, 3.3)
"""
Takes the svn log [options] and turns them into a changelog.
Basic:
--------
2013-11-25:
changed arguments (better handling)
@aquinzi
aquinzi / proDO.py
Last active December 20, 2015 07:09
Displays lines (with number) in files that have TODO or FIXME
# Displays lines in files (grepy) that have TODO or FIXME
# script -> where script runs. script del file num -> del line
import re, os, sys, argparse
import shutil
filesIgnore = ('.bak')
try:
from colorama import Fore, init, Style
@aquinzi
aquinzi / mergetxt.py
Created July 12, 2013 18:07
Script to merge txt files from a given folder to a file (utf-8)
# -*- coding: utf-8 -*-
"""
Script to merge txt files from a given folder
mergetxt path_directory path_output [options: --sep num --fname num]
path_directory: enter 'here' to take the path from where it runs
separator: separator between each file.