Skip to content

Instantly share code, notes, and snippets.

@binary1230
Last active July 10, 2016 16:28
Show Gist options
  • Select an option

  • Save binary1230/cf2cf5bca6842d691931ff9c9b90f867 to your computer and use it in GitHub Desktop.

Select an option

Save binary1230/cf2cf5bca6842d691931ff9c9b90f867 to your computer and use it in GitHub Desktop.

Revisions

  1. binary1230 revised this gist Jul 10, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -20,8 +20,8 @@
    \{\% (checkbox) (.*)\.(.+) \%\}
    {{ macros.$1($2, '$3') }}

    # catch anything like: whatever|tag:"stuff" turn into whatever|tag("stuff")
    \{\{ (.+?(?=|))(.*?):(".*?")
    # catch anything like: whatever|tag:"stuff" turn into whatever|tag("stuff"), also works for single quoted
    \{\{ (.+?(?=|))(.*?):(["'].*?["'])
    \{\{ $1$2($3)

    \{% (stripe_form) ([^\s]+) ([^\s]+) \%\}
  2. binary1230 revised this gist Jun 24, 2016. 1 changed file with 8 additions and 1 deletion.
    9 changes: 8 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -11,12 +11,19 @@
    \{\{ (.+?(?=|))default:"" }}
    {{ $1default('') }}

    \{\{ (.+?(?=|))(yesno):(".*?") }}
    \{\{ (.+?(?=|))(datetime):(".*?") \}\}
    {{ $1$2($3) }}

    \{\{ (.+?(?=|))(yesno):(".*?") \}\}
    {{ $1$2($3) }}

    \{\% (checkbox) (.*)\.(.+) \%\}
    {{ macros.$1($2, '$3') }}

    # catch anything like: whatever|tag:"stuff" turn into whatever|tag("stuff")
    \{\{ (.+?(?=|))(.*?):(".*?")
    \{\{ $1$2($3)

    \{% (stripe_form) ([^\s]+) ([^\s]+) \%\}
    {{ $1\('$2',$3\) }}

  3. binary1230 revised this gist Jun 23, 2016. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -18,4 +18,7 @@
    {{ macros.$1($2, '$3') }}

    \{% (stripe_form) ([^\s]+) ([^\s]+) \%\}
    {{ $1\('$2',$3\) }}
    {{ $1\('$2',$3\) }}

    \{\% (stripe_button) (".*?") \%\}
    \{\{ macros.$1\($2\) \}\}
  4. binary1230 revised this gist Jun 23, 2016. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -15,4 +15,7 @@
    {{ $1$2($3) }}

    \{\% (checkbox) (.*)\.(.+) \%\}
    {{ macros.$1($2, '$3') }}
    {{ macros.$1($2, '$3') }}

    \{% (stripe_form) ([^\s]+) ([^\s]+) \%\}
    {{ $1\('$2',$3\) }}
  5. binary1230 revised this gist Jun 23, 2016. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -7,8 +7,12 @@
    \{\% (checkgroup) (.*)\.(.+) \%\}
    {{ $2.html_$1('$3') }}

    # can improve this by copying from yesno example
    \{\{ (.+?(?=|))default:"" }}
    {{ $1default('') }}

    \{\{ (.+?(?=|))(yesno):(".*?") }}
    {{ $1$2($3) }}

    \{\% (checkbox) (.*)\.(.+) \%\}
    {{ macros.$1($2, '$3') }}
  6. binary1230 revised this gist Jun 23, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@
    {{ $1\($2,$3\) }}

    \{\% (popup_link) (".*?") (".*?") \%\}
    {{ $1\($2,$3\) }}
    {{ macros.$1\($2,$3\) }}

    \{\% (checkgroup) (.*)\.(.+) \%\}
    {{ $2.html_$1('$3') }}
  7. binary1230 revised this gist Jun 23, 2016. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,9 @@
    \{% (options) ([^\s]+) ([^\s]+) \%\}
    {{ $1\($2,$3\) }}

    \{\% (popup_link) (".*?") (".*?") \%\}
    {{ $1\($2,$3\) }}

    \{\% (checkgroup) (.*)\.(.+) \%\}
    {{ $2.html_$1('$3') }}

  8. binary1230 revised this gist Jun 23, 2016. 1 changed file with 2 additions and 3 deletions.
    5 changes: 2 additions & 3 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,8 @@
    \{% (options) ([^\s]+) ([^\s]+) \%\}
    {{ $1\($2,$3\) }}

    # not right
    \{\% (checkgroup) ([^\s]+) \%\}
    \{\{ $1\($2\) \}\}
    \{\% (checkgroup) (.*)\.(.+) \%\}
    {{ $2.html_$1('$3') }}

    \{\{ (.+?(?=|))default:"" }}
    {{ $1default('') }}
  9. binary1230 revised this gist Jun 23, 2016. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,12 @@
    \{% (options) ([^\s]+) ([^\s]+) \%\}
    {{ $1\($2,$3\) }}

    # not right
    \{\% (checkgroup) ([^\s]+) \%\}
    \{\{ $1\($2\) \}\}

    \{\{ (.+?(?=|))default:"" }}
    {{ $1default('') }}
    {{ $1default('') }}

    \{\% (checkbox) (.*)\.(.+) \%\}
    {{ macros.$1($2, '$3') }}
  10. binary1230 revised this gist Jun 23, 2016. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,8 @@
    \{% (options) ([^\s]+) ([^\s]+) \%\}
    {{ $1\($2,$3\) }}

    \{\% (checkgroup) ([^\s]+) \%\}
    \{\{ $1\($2\) \}\}

    \{\{ (.+?(?=|))default:"" }}
    {{ $1default('') }}
  11. binary1230 revised this gist Jun 23, 2016. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,5 @@
    \{% (options) ([^\s]+) ([^\s]+) \%\}
    {{ $1\($2,$3\) }}
    {{ $1\($2,$3\) }}

    \{\{ (.+?(?=|))default:"" }}
    {{ $1default('') }}
  12. binary1230 created this gist Jun 23, 2016.
    2 changes: 2 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    \{% (options) ([^\s]+) ([^\s]+) \%\}
    {{ $1\($2,$3\) }}