Skip to content

Instantly share code, notes, and snippets.

View aam's full-sized avatar

Alexander Aprelev aam

  • Mountain View, CA
View GitHub Profile
@aam
aam / changes.diff
Created May 30, 2014 12:59
changes to Dart as of ~2013 to in attempt to make it work on IE8
Index: sdk/lib/html/dart2js/html_dart2js.dart
===================================================================
--- sdk/lib/html/dart2js/html_dart2js.dart (revision 36540)
+++ sdk/lib/html/dart2js/html_dart2js.dart (working copy)
@@ -35244,7 +35244,7 @@
var options = JS('=Object', '{prototype: #}', proto);
if (extendsTagName != null) {
- JS('=Object', '#.extends = #', options, extendsTagName);
+ JS('=Object', '#.exTends = #', options, extendsTagName);
@aam
aam / gist:5125718
Last active December 14, 2015 17:59
Setting up your client so it can pass proper patches to try-bot for Dart
mac:build aam$ svn diff
Index: third_party/buildbot_8_4p1/buildbot/clients/tryclient.py
===================================================================
--- third_party/buildbot_8_4p1/buildbot/clients/tryclient.py (revision 186891)
+++ third_party/buildbot_8_4p1/buildbot/clients/tryclient.py (working copy)
@@ -57,7 +57,7 @@
def readPatch(self, diff, patchlevel):
if not diff:
diff = None
- self.patch = (patchlevel, diff)
@aam
aam / gist:5125998
Created March 9, 2013 22:15
Make master buildbot to accept patch_subdir coming from the client.
Index: third_party/buildbot_8_4p1/buildbot/schedulers/trysched.py
===================================================================
--- third_party/buildbot_8_4p1/buildbot/schedulers/trysched.py (revision 186833)
+++ third_party/buildbot_8_4p1/buildbot/schedulers/trysched.py (working copy)
@@ -162,7 +162,7 @@
revision=parsed_job['baserev'],
patch_body=parsed_job['patch_body'],
patch_level=parsed_job['patch_level'],
- patch_subdir='', # TODO: can't set this remotely - #1769
+ patch_subdir=parse_job['patch_subdir'],
@aam
aam / gist:5126060
Last active December 14, 2015 17:59
Master buildbot changes so Dart buildbot runs on Windows, supports "try builds" for Dart, supports buildbot slaves that run VS2010 vs VS2012(specified via new "'vs': '2010'" attribute on master definition.
Index: scripts/master/factory/dart_factory.py
===================================================================
--- scripts/master/factory/dart_factory.py (revision 186833)
+++ scripts/master/factory/dart_factory.py (working copy)
@@ -18,6 +18,9 @@
from master.factory import gclient_factory
from master import master_utils
+from common import find_depot_tools
+from common import chromium_utils
@aam
aam / gist:5184998
Created March 18, 2013 03:59
Support redirecting factories in dart VM mirrors API.
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index 4ed5a7d..04043c7 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -3555,14 +3555,16 @@ DART_EXPORT Dart_Handle Dart_New(Dart_Handle clazz,
if (result.IsError()) {
return Api::NewHandle(isolate, result.raw());
}
- // TODO(turnidge): Support redirecting factories.
ASSERT(result.IsFunction());
@aam
aam / gist:5233415
Created March 24, 2013 20:38
HTML: Starter
<!doctype html>
<html>
<head>
<meta charset=utf-8/>
<title/>
<link rel="stylesheet" href="style.css"/>
</head>
<body>
<script src="https://ajax.googeapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"/>
</body>
@aam
aam / gist:5233444
Last active December 15, 2015 08:49 — forked from padolsey/gist:527683
JavaScript: IE Detect
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
@aam
aam / gist:5619322
Last active December 17, 2015 13:48 — forked from anonymous/gist:5599541
Adding "typeof scripts == 'function'" make it work on Safari 5.1
<!DOCTYPE html>
<html lang="en">
<head>
<title>document.currentScript</title>
<meta charset="UTF-8">
</head>
<body>
<h1>document.currentScript</h1>
<pre id="result"></pre>
<script type="application/javascript">
@aam
aam / index.html
Last active December 29, 2016 19:31
Serpinski gasket in Dart
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Serpinski gasket</title>
<link rel="stylesheet" href="styles.css">
<script type="application/dart" src="main.dart"></script>
</head>
@aam
aam / pubspec.yaml
Created March 23, 2018 06:40
`dart --preview-dart-2 bin/t.dart` fails with NoSuchMethodError: The method '_setExpected' was called on null. Receiver: null Tried calling: _setExpected(Closure: (Invocation) => dynamic) dart:core/runtime/libobject_patch.dart 46:5 Object.noSuchMethod package:mockito/src/mock.dart 318:15 PostExpectation._completeWhen package:mockito/src/mock.dar…
name: repro
dependencies:
mockito: 2.2.3