Skip to content

Instantly share code, notes, and snippets.

View sebastianrothbucher's full-sized avatar

Sebastian Rothbucher sebastianrothbucher

View GitHub Profile
@sebastianrothbucher
sebastianrothbucher / .0intro
Last active August 29, 2015 14:22
_changes Hacks on Windows (MINGW32)
Some hacks to demonstrate _changes
1-3: display an MsgBox for each change (with more content)
4: Write to the Windows Event Log on each change
5: Create an asana task on each change
@sebastianrothbucher
sebastianrothbucher / gist:83ba65671e7bdd7510db
Last active August 29, 2015 14:22
3 reasons for doing some project
(understand basic motivations, drivers, chances and pitfalls)
- info hub - get everyone on the same page: the cool part
- automate - structure and batch: the scale part
- enforce some process: the dumb part (if this is the only reason: RUN)
@sebastianrothbucher
sebastianrothbucher / gist:c376e19df87b151a3af1
Created June 26, 2015 11:17
GWT non-obfuscated compile
mvn package -X -Dgwt.style=DETAILED | tee compile.txt
Scope of Replacement (legacy renovation)
Significant part of one screen, no less;
services are easier, as long as you've got tests
(see HTML 5 Article: http://blog-de.akquinet.de/2015/02/04/renewal-legacy-ui-vaadin-html5-postmessage/)
@sebastianrothbucher
sebastianrothbucher / test.sql
Last active August 29, 2015 14:26
PostgreSQL trigger magic (CouchDB-like _changes)
-- tables as they are
create sequence post_id_seq;
create table post (id bigint not null, content text not null, constraint post_pkey primary key(id));
create sequence post_comment_id_seq;
create table post_comment (id bigint not null, post_id bigint not null, content text not null, constraint post_comment_pkey primary key(id), constraint fk_post_comment_post_id foreign key(post_id) references post(id));
-- basics for triggers
create sequence changes_seq;
create or replace function changes_seq_fkt() returns trigger as $$ begin NEW.seq=nextval('changes_seq'); NEW.ts=now(); return NEW; end; $$ language plpgsql;
-- add sequence / ts info to our tables
alter table post add ts timestamp, add seq bigint;
@sebastianrothbucher
sebastianrothbucher / test.sh
Last active August 29, 2015 14:26
Couch dev single node
dev/run -n 1 --with-admin-party-please
@sebastianrothbucher
sebastianrothbucher / gist:23aba1dfeb8b4d66293e
Last active December 4, 2015 07:39
Get requirements right
In order to kick it (based on more or less pleasant experience), you should...
... have few but good documents - most importantly one of them should be a VERY GOOD EXAMPLE (a walkthrough in painstaking detail: invent IDs, names, also Phone #s and so on)
... another one is a comprehensive list of Use Cases (and surrounding systems supporting them; acc. 2 MCQ, you need just few days 2 compile)
... write down what will be checked before signing off the result (aka ATDD)
... rock-solid and well-thought-through core classes (data model, UI structure)
... adjust regularly, but not always (i.e. do sprints)
@sebastianrothbucher
sebastianrothbucher / login.json
Last active August 29, 2015 14:27
Couch Login form (sep. public DB)
{
"_id": "_design/login",
"redir": "/somepath",
"usage": "Deploy (i.e. add as doc - verbatim) to a DB that is public, call as /dbname/_design/login/_show/login?redir?/someredirpath (where the query param is optional and falls back to 'redir' in the design doc. Advantage: Browsers (esp. iPhone) can remember credentials",
"shows": {
"login": "function(doc, req){return \"<html><head><meta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1\\\" /></head><body><form action=\\\"/_session?next=\"+(req.query.redir?req.query.redir:this.redir)+\"\\\" method=\\\"POST\\\">User: <input type=\\\"text\\\" name=\\\"name\\\" /><br />Pass: <input type=\\\"password\\\" name=\\\"password\\\" /><br /><input type=\\\"submit\\\" /></form></body></html>\"}"
}
}
@sebastianrothbucher
sebastianrothbucher / gist:024864d764f1420f3de7
Created October 18, 2015 13:10
Find Transpiled test files no more relevant
#!bash
for i in $(find . -name '*pec.react.js')
do
if [ ! -f ${i}x ]
then
echo $i
fi
done
@sebastianrothbucher
sebastianrothbucher / gist:4d4fb23aef96810f8ad6
Created October 25, 2015 12:38
Wait 4 Postgres 2 be up and running
#!bash
export PGPASSWORD=testpw #fill in no-priv PW
wt=0
while [ true ]
do
psql -U vaadin -c 'select * from dual' #create dual
if [ $? = 0 ]
then
echo "all is OK"
break