Skip to content

Instantly share code, notes, and snippets.

Avatar

jakub-g jakub-g

View GitHub Profile
@jakub-g
jakub-g / gist:6881528
Created Oct 8, 2013
Attester 1.2.1 slowest tests
View gist:6881528
cat attesterlog.log | grep "default browser" | cut -d" " -f2,10 | tr -d '[' | sort -n -r | less
View InstantTemplate.tpl
{macro main()}
<h1># ${ (true) && (true) }</h1>
<h1># ${ (true) && (false) }</h1>
<h1># ${ (5 + 12*12) % 100 }</h1>
<h1># ${ (5==5) ? "a" : "b"}</h1>
//template error: invalid modifier syntax
//<h1># ${ 8 | 16 }</h1>
//<h1># ${ (true) || (false) }</h1>
@jakub-g
jakub-g / InstantTemplate.tpl
Created Oct 18, 2013
Modifiers and whitespace
View InstantTemplate.tpl
{macro main()}
<h1>Hello Instant Aria Templates</h1>
{/macro}
@jakub-g
jakub-g / gist:7451108
Last active Dec 28, 2015
Find git commits touching only files from a specific folder
View gist:7451108
git log --reverse --format="%h / %cd / %an / %s" --date=short master -- src/main/static
@jakub-g
jakub-g / gist:7481694
Created Nov 15, 2013
git show, with full file path
View gist:7481694
git show --stat=200
// 200 is screen width, to be adjusted
@jakub-g
jakub-g / git-diff-stat-sort.sh
Last active Jan 3, 2020
sort git diff --stat starting from the files that have most lines changed
View git-diff-stat-sort.sh
git show HEAD --stat=200 | tail +7 | awk '{ print $3 " "$4 " " $1}' | sort -n -r | less
@jakub-g
jakub-g / normalize-trailing-newline.sh
Last active Dec 29, 2015
Normalize trailing newlines
View normalize-trailing-newline.sh
find . -type f \( -name "*.htm*" -or -name "*.js*" -or -name "*.css" -or -name "*.*ml" -or -name "*.tpl" -or -name "*.md" -or -name "*.txt" \) -exec sh -c 'echo -e "\r\n" >> "$0" ' {} \; -exec sed --in-place -e :a -e '/^\n*$/{$d;N;};/\n$/ba' {} \;
@jakub-g
jakub-g / findLongTryCatch.sh
Last active Dec 30, 2015
Find long try-catch instances in the code (not super bulletproof but kinda works)
View findLongTryCatch.sh
$ find . -name '*.js' -exec awk -v gap=15 '/try/ {inside=1; diff=0; next} inside{diff++} /catch/ && inside && (diff>=gap) {print diff,"L",NR-diff,FILENAME; inside=0;}' {} \;
@jakub-g
jakub-g / gist:dddd8f3cdd11efdfd65e
Created Sep 23, 2014
Run nodist-installed grunt in node debug mode
View gist:dddd8f3cdd11efdfd65e
node --debug-brk /d/bin/nodist/bin/node_modules/grunt-cli/bin/grunt
@jakub-g
jakub-g / InstantTemplate.tpl
Last active Aug 29, 2015
Aria Templates common mistakes: not using $json.setValue
View InstantTemplate.tpl
{macro main()}
<button {on click "updateModelBad" /}>Update counter</button>
<button {on click "updateModelBetter" /}>Update counter (better)</button>
<br>
Counter has value of: {@aria:Text {
text : this.data.counter,
bind : {
text : {
inside: this.data,
You can’t perform that action at this time.