Skip to content

Instantly share code, notes, and snippets.

View jakub-g's full-sized avatar
💭
I may be slow to respond.

jakub-g jakub-g

💭
I may be slow to respond.
  • Antibes, France
  • 18:19 (UTC +02:00)
View GitHub Profile
@jakub-g
jakub-g / grep.sh
Created November 30, 2017 13:18
Grep multiple files, have output grouped per file
for file in app/src/main/res/*/strings.xml ; do echo -e "\n$file\n"; grep "TEST" $file; done
@jakub-g
jakub-g / gist:11db6fc3eabf421cfc6bff0bfc630912
Last active January 26, 2018 15:13
apache logs grepping aliases
#to better handle spaces in URL:
# cut -d'"' -f1,2 | cut -d' ' -f1,4-
#instead of
# cut -d" " -f1,4,5
#alias ag-sort-by-ip-url-freq='cut -d" " -f1,4,5 | sed "s/\(GET\|POST\|HEAD\) //" | cut -d"|" -f2,4 | sed -r "s/\|(\b[0-9]{1,3}\.){3}[0-9]{1,3}\b//" | awk "{ print \$2 \" \" \$1}" | sort | uniq -c | sort -nr'
#alias ag-sort-by-url-freq="cut -d' ' -f4,5 | sed 's/\(GET\|POST\|HEAD\) //' | sort | uniq -c | sort -nr"
alias ag-sort-by-ip-url-freq='cut -d'\"' -f1,2 | cut -d" " -f1,4- | sed "s/\(GET\|POST\|HEAD\) //" | cut -d"|" -f2,4 | sed -r "s/\|(\b[0-9]{1,3}\.){3}[0-9]{1,3}\b//" | awk "{ print \$2 \" \" \$1}" | sort | uniq -c | sort -nr'
@jakub-g
jakub-g / gist:cec1ed434c4692dd7624c801c86ae1ed
Created February 26, 2018 09:47
FiddlerSkipHttpsDecryption.ini
*.google-analytics.com; *.virtualearth.net; *.google.com; *.googleadservices.com; *.githubusercontent.com; *.github.com; *.webexconnect.com; *.facebook.com; *.fbcdn.net; *.gstatic.com; *.branch.io; *.apple.com; *.icloud.com; *.googleapis.com; *.apple.news; *.crashlytics.com; *.accuweather.com; *.htcsense.com; *.googleapis.com; *.google.com; helpnewsrepublic1.ksmobile.com
@jakub-g
jakub-g / gist:5e46c8f3f1a8b3b3eb4627e5cf3e2513
Created March 6, 2018 10:49
Curl just response headers
curl -s -D - https://www.google.com/ -o /dev/null
@jakub-g
jakub-g / gist:fe7eb97bcce25b5ecf06657a7dc1119c
Created March 9, 2018 13:58
git bash cmd color palette
1=0,99,201
2=0,160,0
4=180,0,0
@jakub-g
jakub-g / jq.sh
Last active July 10, 2018 12:01
jq usage snippets
cat webpack.json | jq '.chunks[] | {id:.id, parents:.parents, modules:.modules} | del(.modules[].source) | del(.modules[].optimizationBailout)' | less > ../../player-bundle-analysis/webpack.json
cat ../../player-bundle-analysis/webpack.json | jq '{(.id):(.modules)}' | jq -n '[inputs]'
@jakub-g
jakub-g / gist:5824f4a704b0ea3b1b58ac971ff1320c
Created July 11, 2018 09:21
ls: files by size in KB (1024 bytes), one per line
ls -s1 --block-size=K
@jakub-g
jakub-g / vscode.json
Last active July 20, 2018 14:27
VS Code custom settings on Windows
{
"window.zoomLevel": 1,
"window.title": "${rootPath}${separator}${activeEditorMedium}${separator}${appName}",
"workbench.editor.enablePreview": false,
"workbench.editor.enablePreviewFromQuickOpen": false,
"editor.mouseWheelZoom": true,
"window.menuBarVisibility": "default",
"window.titleBarStyle": "custom",
"files.eol": "\n"
}
@jakub-g
jakub-g / chrome-perf-tab.md
Created February 20, 2019 13:34
Measuring performance in Chrome devtools - best practices
  1. Use Chrome Beta/Dev/Canary
  2. Open incognito tab, to make sure no extensions are interfering with page loading and adding delays (React dev tools etc)
  3. Open an empty tab each time, open devtools, go to Performance tab
  4. Click CTRL-E to start profiling
  5. Only now enter the URL in the URL bar
@jakub-g
jakub-g / debug.md
Created February 25, 2019 08:12
Debug guide
  • Check that you're debugging the proper file (correct URL, correct folder etc.)

  • Nuclear option: remove everything

  • Check the errors

  • Compare behavior before and after

  • Compare logs before and after

  • Check the commits in the meantime

  • "Nothing happens, and no errors": Look for missing callbacks