Skip to content

Instantly share code, notes, and snippets.

@jjergus
jjergus / apidoc.patch
Created September 9, 2019 19:46
fixed hh-apidoc
diff -U 3 old/class.Facebook.HHAPIDoc.DocBlock.DocBlock.html new/class.Facebook.HHAPIDoc.DocBlock.DocBlock.html
--- old/class.Facebook.HHAPIDoc.DocBlock.DocBlock.html 2019-09-09 11:52:38.646786217 -0700
+++ new/class.Facebook.HHAPIDoc.DocBlock.DocBlock.html 2019-09-09 12:41:44.617795497 -0700
@@ -56,7 +56,7 @@
<h3>Public Methods</h3>
<ul>
-<li><a href="class.Facebook.HHAPIDoc.DocBlock.DocBlock.nullable.html"><code>::nullable(?string $comment): ?\this</code></a><br />
+<li><a href="class.Facebook.HHAPIDoc.DocBlock.DocBlock.nullable.html"><code>::nullable(?string $comment): ?this</code></a><br />
Create a new instance if a comment is provided</li>
@jjergus
jjergus / hhvm-docs.patch
Created September 9, 2019 21:58
hhvm docs fixes
diff -r -U 3 user-documentation-old/build/final/api-html/hack/class.AsyncMysqlClient.html user-documentation/build/final/api-html/hack/class.AsyncMysqlClient.html
--- user-documentation-old/build/final/api-html/hack/class.AsyncMysqlClient.html 2019-09-09 14:49:58.296273393 -0700
+++ user-documentation/build/final/api-html/hack/class.AsyncMysqlClient.html 2019-09-09 14:40:13.519586751 -0700
@@ -24,7 +24,7 @@
Create a new async connection from a synchronous MySQL instance</li>
<li><a href="/hack/reference/class/AsyncMysqlClient/connect/"><code>::connect(string $host, int $port, string $dbname, string $user, string $password, int $timeout_micros = -1, ?MySSLContextProvider $ssl_provider = NULL): Awaitable&lt;AsyncMysqlConnection&gt;</code></a><br />
Begin an async connection to a MySQL instance</li>
-<li><a href="/hack/reference/class/AsyncMysqlClient/connectAndQuery/"><code>::connectAndQuery( arraylike&lt;string, arraykey&gt; $queries, string $host, int $port, string $dbname, string $user, string $password,
@jjergus
jjergus / byref.md
Last active September 17, 2019 16:44
byref.md

Class methods

  • currently no automated migration provided
  • we could add one, if we implemented proper detection of the Hack type of an arbitrary expression
  • not sure if worth doing, since there's not many of them and nothing seems very commonly used

These have (or will soon have) an optional by-ref arg removed, and a new variant is provided with the equivalent non-optional inout argument:

NumberFormatter::parse -> parseWithPosition
@jjergus
jjergus / docs-linkify.patch
Created September 19, 2019 19:16
docs-linkify.patch
This file has been truncated, but you can view the full file.
diff -r -U 3 ../tmp-build-old/final/api-html/hack/class.AsyncMysqlClient.method.connect.html build/final/api-html/hack/class.AsyncMysqlClient.method.connect.html
--- ../tmp-build-old/final/api-html/hack/class.AsyncMysqlClient.method.connect.html 2019-09-19 11:41:23.913744773 -0700
+++ build/final/api-html/hack/class.AsyncMysqlClient.method.connect.html 2019-09-19 12:14:41.978501843 -0700
@@ -32,7 +32,7 @@
<h2 class="headingWithAnchor" id="returns">Returns<a href="#returns"><i class="glyphIcon fa fa-link"></i></a></h2>
<ul>
<li><a href="/hack/reference/class/HH.Awaitable/"><code>Awaitable&lt;AsyncMysqlConnection&gt;</code></a> - an <a href="/hack/reference/class/HH.Awaitable/"><code>Awaitable</code></a> representing an <a href="/hack/reference/class/AsyncMysqlConnection/"><code>AsyncMysqlConnection</code></a>. <code>await</code>
-or <a href="/hsl/reference/function/HH.Lib.Str.join/"><code>join</code></a> this result to obtain the actual connection.</li>
+or <code>join</code> this result to obtain the actual
@jjergus
jjergus / docs-magic.patch
Created September 27, 2019 22:46
docs-magic.patch
diff -r -U 3 ../tmp-build-old/final/api-html/hack/class.AsyncMysqlClient.method.adoptConnection.html build/final/api-html/hack/class.AsyncMysqlClient.method.adoptConnection.html
--- ../tmp-build-old/final/api-html/hack/class.AsyncMysqlClient.method.adoptConnection.html 2019-09-27 12:30:15.762833549 -0700
+++ build/final/api-html/hack/class.AsyncMysqlClient.method.adoptConnection.html 2019-09-27 15:45:16.752502745 -0700
@@ -27,11 +27,7 @@
<p>This example shows how to take a synchronous MySQL connection and convert it to use an asynchronous MySQL connection via <a href="/hack/reference/class/AsyncMysqlClient/adoptConnection/"><code>AsyncMysqlClient::adoptConnection()</code></a>.</p>
<p><strong>NOTE</strong>: Right now this does not work with <code>mysqli</code> or <code>PDO</code> connections.</p>
<div class="highlight fbgfm source-language-Hack">
-<pre><code class="language-PHP">&lt;?hh // partial
-
-namespace Hack\UserDocumentation\API\Examples\AsyncMysql\Client\AdoptConn;
@jjergus
jjergus / aws-fix.patch
Created October 5, 2019 20:59
aws-fix.patch
--- grapheneConsole_prod_9891aad10fbfee486a25652151996660992a4062.js 2019-10-01 09:14:21.000000000 -0700
+++ grapheneConsole_prod_fixed.js 2019-10-05 13:58:19.270413078 -0700
@@ -21394,20 +21394,21 @@
}
};
return getNextPage([], nextToken, true);
}
function selectStateInstanceFromIterationTree(stateInstanceIterations, selectedMapIterations) {
var currentStateInstanceIterations = stateInstanceIterations;
@jjergus
jjergus / aws-step-function.json
Created October 5, 2019 21:14
aws-step-function.json
// example input:
{
"outerItems": [
{"innerItems": ["foo", "bar"]},
{"innerItems": ["herp", "derp"]}
]
}
@jjergus
jjergus / hhast.patch
Created October 11, 2019 19:41
hhast.patch
diff --git a/codegen/inferred_relationships.hack b/codegen/inferred_relationships.hack
index 237f59aa..c80ae11f 100644
--- a/codegen/inferred_relationships.hack
+++ b/codegen/inferred_relationships.hack
@@ -1,7 +1,7 @@
/**
* This file is generated. Do not modify it manually!
*
- * @generated SignedSource<<819c2b4031a964ad0ba680ced0e3cd74>>
+ * @generated SignedSource<<4212321d8474cb6fcc048c4849466df2>>
$ /opt/hhvm/4.26.0~/bin/hh_client --json --search-function 'Facebook\AutoloadMap\TestData\MixedCaseFunction'
[]
$ /opt/hhvm/4.26.0~/bin/hh_client --json --search-function 'Facebook\\AutoloadMap\\TestData\\MixedCaseFunction'
[{"name":"Facebook\\AutoloadMap\\TestData\\MixedCaseFunction","filename":"/home/jjergus/work/code/hhvm-autoload/testdata/MixedCaseFunction.php","desc":"function","line":13,"char_start":10,"char_end":56,"scope":""}]
$ /opt/hhvm/4.27.0/bin/hh_client --json --search-function 'Facebook\AutoloadMap\TestData\MixedCaseFunction'
[]
$ /opt/hhvm/4.27.0/bin/hh_client --json --search-function 'Facebook\\AutoloadMap\\TestData\\MixedCaseFunction'
Vec
(
[0] => use-hphpc
[1] => src-hphp
[2] => pre-hhvm
[3] => nightly-2019.12.05
[4] => nightly-2019.12.04
[5] => nightly-2019.12.03
[6] => nightly-2019.12.02
[7] => nightly-2019.12.01