Skip to content

Instantly share code, notes, and snippets.

Michael Nutt mnutt

Block or report user

Report or block mnutt

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
mnutt /
Created Jun 6, 2019
Prettier project wrapper
# This wrapper prefers your project's prettier version, and only runs prettier if your project has configured it.
# Save this file as `prettier` in your $PATH, or set your editor's prettier plugin to use it as the prettier binary
# find the file prettier is trying to prettify
# optionally set where the real prettier command can be found
mnutt / before-async-await.js
Last active May 15, 2019
In-memory write-through cache with async/await
View before-async-await.js
// before async/await
cache.oldThrough(cacheKey, function getData(cb) {
fetch(appUrl, function(response) {
response.text(function(data) {
}, function (template) {

Some HTML attack vectors (not all)


  • via XHR
    • sends user's cookies
    • cross-origin restrictions protect against malicious sites, unless you have bad CORS settings
  • via form
    • sends user's cookies
    • need to protect with csrf token
    • or you can prevent form POST entirely with x-requested-with request header check
View example.sketch.json
"_class": "page",
"do_objectID": "E3FF0D84-6B60-4A08-80D9-EDDA368D2198",
"booleanOperation": -1,
"exportOptions": {
"_class": "exportOptions",
"exportFormats": [],
"includedLayerIds": [],
"layerOptions": 0,
"shouldTrim": false
mnutt /
Last active Sep 5, 2019
TreeStyleTab sidebar tabs only
mnutt /
Last active Jan 22, 2018
Only run prettier if a config file is present
# find the file prettier is trying to prettify
# optionally set where the real prettier command can be found
prettier=`which prettier`
# try to see if there is a project-specific `prettier` to use
node_modules=`npm root`
View mac-framework-includes-take-2.patch
diff --git a/Source/cmake/WebKitMacros.cmake b/Source/cmake/WebKitMacros.cmake
index 4c54c1c5de1..858e2e47d8d 100644
--- a/Source/cmake/WebKitMacros.cmake
+++ b/Source/cmake/WebKitMacros.cmake
@@ -265,6 +265,8 @@ macro(WEBKIT_FRAMEWORK _target)
+ ${${_target}_PRIVATE_HEADERS}
+ ${${_target}_PUBLIC_HEADERS}
View mac_framework_includes.patch
diff --git a/Source/WebKit/PlatformQt.cmake b/Source/WebKit/PlatformQt.cmake
index 909efc00dba..59f8f7eab45 100644
--- a/Source/WebKit/PlatformQt.cmake
+++ b/Source/WebKit/PlatformQt.cmake
@@ -410,11 +410,19 @@ generate_header("${FORWARDING_HEADERS_DIR}/QtWebKit/QtWebKitDepends"
+ set(WebKit_INCLUDE_DESTINATION "${LIB_INSTALL_DIR}/QtWebKit.framework/Versions/5/Headers")

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

View raise_qtwebkit_connection_count.patch
diff --git a/Source/WebCore/platform/network/qt/ResourceRequestQt.cpp b/Source/WebCore/platform/network/qt/ResourceRequestQt.cpp
index b7f9447bc..b14c53e9f 100644
--- a/Source/WebCore/platform/network/qt/ResourceRequestQt.cpp
+++ b/Source/WebCore/platform/network/qt/ResourceRequestQt.cpp
@@ -37,7 +37,7 @@ namespace WebCore {
// and 2 ready to re-fill the pipeline.
unsigned initializeMaximumHTTPConnectionCountPerHost()
- return 6 * (1 + 3 + 2);
+ return 5000;
You can’t perform that action at this time.