Skip to content

Instantly share code, notes, and snippets.

View jakub-g's full-sized avatar

jakub-g jakub-g

  • Antibes, France
  • 03:22 (UTC +02:00)
View GitHub Profile
@jakub-g
jakub-g / gist:6881528
Created October 8, 2013 08:34
Attester 1.2.1 slowest tests
cat attesterlog.log | grep "default browser" | cut -d" " -f2,10 | tr -d '[' | sort -n -r | less
{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 October 18, 2013 14:44
Modifiers and whitespace
{macro main()}
<h1>Hello Instant Aria Templates</h1>
{/macro}
@jakub-g
jakub-g / gist:7481694
Created November 15, 2013 09:35
git show, with full file path
git show --stat=200
// 200 is screen width, to be adjusted
@jakub-g
jakub-g / normalize-trailing-newline.sh
Last active December 29, 2015 02:19
Normalize trailing newlines
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 December 30, 2015 22:28
Find long try-catch instances in the code (not super bulletproof but kinda works)
$ 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:0e7bee5c101c6e5d03879d0229174339
Last active May 9, 2016 11:56
angular 1.4.3 http code 0
ERR_TUNNEL_CONNECTION_FAILED (connecting to http server that is down)
request timeout
airplane mode
* text=auto
*.htm text diff=html
*.html text diff=html
*.java text diff=java
*.properties text
*.js text
*.json text
*.jsonp text
*.jsp text
@jakub-g
jakub-g / gist:4d5cd6d829608d86cba3c66d260d8aa9
Created November 30, 2016 15:25
HTTPS SSL certs issues
openssl s_client -showcerts -connect yourhost.com:443
http://stackoverflow.com/questions/24573037/webview-and-ssl-certificates
@jakub-g
jakub-g / gist:17cb54694a72dd968dd4daf1f98b0832
Created January 12, 2017 13:17
node and npm from maven
#!/usr/bin/env node
var path = require('path');
// note this is required on maven BEFORE npm install so it can not be outsourced to ng-scripts
var execWithEnv = require('./execWithEnv');
var exec = function(command) {
command = command + ' --no-color';
var cwd = process.cwd();