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
(defun ledger-move-transaction-up () | |
(interactive) | |
(save-excursion | |
(let* ((ext-A (ledger-navigate-find-element-extents (point))) | |
(prev (ledger-navigate-prev-xact-or-directive)) | |
(ext-B (ledger-navigate-find-element-extents (point))) | |
(start-A (car ext-A)) | |
(end-A (cadr ext-A)) | |
(start-B (car ext-B)) | |
(end-B (cadr ext-B)) |
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
<?php | |
$CONFIG = array ( | |
'mail_domain' => '@mailDomain@', | |
'mail_smtpmode' => 'sendmail', | |
'datadirectory' => '@dataDir@', | |
'apps_paths' => | |
array ( | |
0 => | |
array ( | |
'path' => '@apps2Dir@', |
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
class Duration(timedelta): | |
def __new__(cls, value): | |
if isinstance(value, timedelta): | |
return cls(value.total_seconds()) | |
return super(Duration, cls).__new__(cls, seconds=value) | |
@classmethod | |
def parse(cls, s): | |
sign = 1 | |
if s[0] == '-': |
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
import petl | |
import decimal | |
from beancount.core import data | |
NUMERIC = [int, float, decimal.Decimal, data.Amount] | |
def render(table, colsep=' ', narrow=True, numeric=None): |
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
import click | |
@click.command() | |
@click.option('--verbose', '-v', type=int, count=True) | |
def main(verbose): | |
print(verbose) | |
# add an option | |
click.option('--times', '-n', type=int)(main) |
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
class EntryPrinter(printer.EntryPrinter): | |
def __init__(self, currency_column=50): | |
super().__init__() | |
self.target_currency_column = currency_column | |
def Transaction(self, entry, oss): | |
# Compute the string for the payee and narration line. | |
strings = [] | |
if entry.payee: | |
strings.append('"{}"'.format(misc_utils.escape_string(entry.payee))) |
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
import click | |
import decimal | |
from beancount.core import data | |
from beancount import loader | |
from beancount.parser import parser | |
from beangadgets import printer | |
from sklearn.feature_extraction.text import TfidfVectorizer, TfidfTransformer, CountVectorizer | |
from sklearn.svm import LinearSVC |
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
option = get_option('gallium-drivers') | |
gallium_drivers = [] | |
foreach driver in option: | |
if driver == 'auto': | |
... | |
else: | |
gallium_drivers += driver | |
endif | |
endforeach |