Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
directory=${1:-""}
percentage=${2:-"25"}
watermark_image=${3:-"watermark.png"}
location="southwest"
if [ -z "$directory" ]; then
echo "Error: directory argument is required"
exit 1
import itertools
import sys
from filch import boards
from filch import configuration
from filch import constants
from filch import data
from filch import exceptions as peeves
BOARD_NAME = "Workflows-DFG-Rocky"
@rbrady
rbrady / sample_report.py
Created June 21, 2018 15:08
Sample Report
class ExternalEffortReport(reports.FileReport):
template_name = "/home/rbrady/ee_rpt.txt",
output_name = "/home/rbrady/external_efforts.txt"
def get_context_data(self, **kwargs):
# Call the base implementation first to get a context
context = super(ExternalEffortReport, self).get_context_data(**kwargs)
# get a reference to the desired cards
config = configuration.get_config()
manager = boards.BoardManager(config['trello'], BOARD_NAME)
@rbrady
rbrady / Unit3.java
Last active September 5, 2017 12:42
Example java class for Mike
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.Scanner;
public class Unit3 {
private static final String FILENAME = "energyProduced.txt";
private static final double ELECTRICITY_COST = 0.85;
@rbrady
rbrady / watermark.sh
Created June 24, 2017 02:47
Resize and Watermark images with ImageMagick
#!/bin/bash
# change dir to the first arg to the script
cd $1
if [[ "$2" != "" ]]; then
FONT_TYPE="$2"
else
FONT_TYPE="Helvetica"
fi
@rbrady
rbrady / example_trello_report_output.txt
Created March 9, 2017 13:58
Sample Trello Report Output
my-trello-board
--------------------
- Backlog
- Write code for feature C
- Write code for feature D
- In Progress
@rbrady
rbrady / board_report_jinja_example.txt
Created March 9, 2017 13:50
Sample Jinja Template
{{ board.name }}
--------------------
{% for list_item in board.open_lists() %}
- {{ list_item.name }}
{% for card in list_item.list_cards() %}
- {{ card.name }}
{% endfor %}
{% endfor %}
@rbrady
rbrady / board_query_snippet.py
Created March 9, 2017 13:49
Board Query Snippet
# check for board existence
board = [b for b in trello_api.list_boards() if b.name == board_name][0]
# if no board, print error and exit
if not board:
click.echo("Trello board not found!")
sys.exit(1)
# create board context
context = {'board': board}
@rbrady
rbrady / mistral_mixins_usage_example.py
Last active March 9, 2017 15:21
Mistral Custom Actions ~ With Mixins (Usage)
import base
class MyCustomAction(base.Action):
def run(self):
return "I ran"
class MyAsyncAction(base.AsyncMixin, base.Action):
@rbrady
rbrady / mistral_mixins_example.py
Last active March 9, 2017 04:48
Mistral Custom Actions ~ Using Mixins
import abc
class Action(object):
@abc.abstractmethod
def run(self):
pass