-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Faker & make length of lipsum (Paragraphs) configurable
- Many new locales - Update Alfred-Workflow - Number of sentences per paragraph now configurable - Add useful links to `fakeconf` - Make keyword configurable via configuration sheet
- Loading branch information
Showing
427 changed files
with
43,232 additions
and
7,543 deletions.
There are no files selected for viewing
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
Binary file not shown.
Binary file not shown.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/env python | ||
# encoding: utf-8 | ||
# | ||
# Copyright (c) 2014 [email protected] | ||
# | ||
# MIT Licence. See http://opensource.org/licenses/MIT | ||
# | ||
# Created on 2014-12-29 | ||
# | ||
|
||
"""Print sample fake data to STDOUT.""" | ||
|
||
from __future__ import print_function, absolute_import | ||
|
||
import sys | ||
import os | ||
|
||
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__) + '/../src/libs')) | ||
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__) + '/../src')) | ||
|
||
|
||
def main(): | ||
"""Print sample fake data.""" | ||
from workflow import Workflow | ||
import fakeum | ||
|
||
wf = Workflow() | ||
fakeum.wf = wf | ||
print('| Name | Example |') | ||
print('|-- |--|') | ||
for name in fakeum.FAKERS: | ||
ex = fakeum.get_fake_datum(name) | ||
print(u'| {} | {} |'.format(name, ex).encode('utf-8')) | ||
|
||
|
||
if __name__ == '__main__': | ||
sys.exit(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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
#!/usr/bin/env zsh | ||
|
||
set -e | ||
|
||
# URL of icon generator | ||
api="http://icons.deanishe.net/icon" | ||
here="$( cd "$( dirname "$0" )"; pwd )" | ||
root="$( cd "$here/../"; pwd )" | ||
# where workflow icons belong | ||
icondir="${root}/src/icons" | ||
# icon config file | ||
iconfile="${root}/icons.txt" | ||
|
||
prog="$( basename "$0" )" | ||
|
||
force=false | ||
verbose=false | ||
vopt= | ||
icons=() | ||
|
||
# log <arg>... | Echo arguments to STDERR | ||
log() { | ||
echo "$@" >&2 | ||
} | ||
|
||
# info <arg>.. | Write args to STDERR if VERBOSE is true | ||
info() { | ||
$verbose && log $(print -P "%F{blue}..%f") "$@" | ||
return 0 | ||
} | ||
|
||
# success <arg>.. | Write green "ok" and args to STDERR if VERBOSE is true | ||
success() { | ||
$verbose && log $(print -P "%F{green}ok%f") "$@" | ||
return 0 | ||
} | ||
|
||
# error <arg>.. | Write red "error" and args to STDERR | ||
error() { | ||
log $(print -P '%F{red}error%f') "$@" | ||
} | ||
|
||
# fail <arg>.. | Write red "error" and args to STDERR, then exit with status 1 | ||
fail() { | ||
error "$@" | ||
exit 1 | ||
} | ||
|
||
# load | Read configuration file from STDIN | ||
load() { | ||
typeset -g icons | ||
while read line; do | ||
|
||
# ignore lines that start with # or are empty | ||
[[ $line =~ "#" ]] || test -z "$line" && continue | ||
|
||
read fname font colour name <<< "$line" | ||
icons+=($fname $font $colour $name) | ||
|
||
done | ||
} | ||
|
||
usage() { | ||
cat <<EOF | ||
$prog [options] | ||
Download icons from server. | ||
Usage: | ||
$prog [-v] [-f] | ||
$prog -h | ||
Options: | ||
-f Force re-download | ||
-h Show this help message and exit | ||
-v Be verbose | ||
EOF | ||
} | ||
|
||
while getopts ":fhv" opt; do | ||
case $opt in | ||
f) | ||
force=true;; | ||
h) | ||
usage | ||
exit 0;; | ||
v) | ||
verbose=true | ||
vopt='-v' | ||
;; | ||
\?) | ||
fail "invalid option: -$OPTARG";; | ||
esac | ||
done | ||
shift $((OPTIND-1)) | ||
|
||
|
||
cat "$iconfile" | load | ||
|
||
success "loaded config from $iconfile" | ||
|
||
total=$(( ${#icons} / 4 )) | ||
fetched=0 | ||
j=0 | ||
for (( i=1; i<${#icons}; i=i+4 )); do | ||
j=$(( j + 1 )) | ||
|
||
fname=$icons[$i] | ||
font=$icons[$i+1] | ||
colour=$icons[$i+2] | ||
name=$icons[$i+3] | ||
|
||
# info "j=$j, name=$name, font=$font, fname=$fname" | ||
|
||
url="${api}/${font}/${colour}/${name}" | ||
n="${fname}.png" | ||
p="$icondir/$n" | ||
pc="[$j/$total]" | ||
|
||
# download source icon | ||
copts=(-L) | ||
$verbose && copts+=(-#) || copts+=(-sS) | ||
$force || ! test -s "$p" && { | ||
curl $copts -o "$p" "$url" | ||
[[ $? -ne 0 ]] && fail "couldn't download $n" | ||
success "downloaded $n" | ||
fetched=$(( fetched + 1 )) | ||
} || { | ||
info "skipped existing $n" | ||
} | ||
|
||
done | ||
|
||
verbose=true | ||
success "downloaded $fetched icon(s)" | ||
|
||
exit 0 |
Oops, something went wrong.