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
<p> | |
{{ form.name.errors }} | |
<label for=id_name>Name:</label> | |
{{ form.name }} | |
</p> | |
<p> | |
{{ form.is_captain.errors }} | |
<label for=id_is_captain>Is Captain?:</label> | |
{% if user %} | |
<input type=checkbox name=is_captain id=id_is_captain {% if object.is_captain %}checked{% endif %}> |
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
class PirateForm(ModelForm): | |
class Meta: | |
model = Pirate | |
fields = ("name", "is_captain") | |
def __init__(self, *args, **kwargs): | |
user = kwargs.pop("user", None) | |
super().__init__(*args, **kwargs) | |
if not user: |
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 python | |
import os | |
import re | |
import subprocess | |
import sys | |
CHANGELOG_FILE = "HISTORY.rst" | |
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 python | |
import os | |
import re | |
import subprocess | |
import sys | |
CHANGELOG_FILE = "HISTORY.rst" | |
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 ruby | |
puts "#{"PID".ljust(7)} PROCESS" | |
lines = %x(ps auxfwww|grep " simplefl[o]w ").lines.map do |line| | |
stats, command = line.split("|", 2) | |
tokens = stats.split | |
{ pid: tokens[1], command: command } | |
end |
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 time | |
import signal | |
def abrt_handler(signum, frame): | |
print "Hey I catched a signal {}".format(signum) | |
signal.signal(signal.SIGABRT, abrt_handler) | |
while True: | |
time.sleep(5) |
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 ruby | |
def children(ps, pid) | |
ps.select do |p| | |
p.split[2] == pid | |
end | |
end | |
def pid_from_line(line) | |
line.split[1] |
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
#!/bin/bash | |
if [ "$1" == "clone" ]; then | |
repo=$(echo $3|sed 's#.*/##') | |
key="$HOME/.ssh/id_rsa_$repo" | |
if [ -e "$key" ]; then | |
export GIT_SSH="ssh -i $key -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" | |
fi | |
fi | |
git $* |
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 notify(msg): | |
print "NOTIFY: {}".format(msg) | |
def process(): | |
#... | |
notify = False | |
if notify: | |
# take action | |
print "processing!" | |
#... |
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
diff --git a/examples/basic.py b/examples/basic.py | |
index 1b5e538..f431c59 100644 | |
--- a/examples/basic.py | |
+++ b/examples/basic.py | |
@@ -17,10 +17,18 @@ def double(x): | |
return x * 2 | |
+# simpleflow activities can be classes ; in that case the class is instantiated | |
+# with the params passed via submit, then the `execute()` method is called and |