Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

// ==UserScript==
// @name Unqualified Top Test
// @namespace https://github.com/arantius
// @include *
// ==/UserScript==
var left = top = 0;
alert('I managed to run\nvar left = top = 0;');
// ==UserScript==
// @name document.write() test
// @include *
// ==/UserScript==
document.write('The document.write() method works.');
document.close();
@arantius
arantius / angular-radio-input.html
Created February 9, 2011 15:04
Demonstrating lack of initialization on <input type="radio"> fields.
<!doctype html>
<html xmlns:ng="http://angularjs.org">
<script src="http://code.angularjs.org/angular-0.9.10.min.js" ng:autobind></script>
<body>
<form ng:init="form={'value':'gamma', choices: ['alpha','beta','gamma']}">
<label ng:repeat="choice in form.choices">
<input type="radio" name="form.value" value="{{choice}}"> {{choice}}<br>
</label>
<pre>{{form}}</pre>
</form>
<!doctype html>
<html xmlns:ng="http://angularjs.org">
<head>
<title>Angular Title Test</title>
<script src="http://code.angularjs.org/angular-0.9.10.min.js" ng:autobind></script>
</head>
<body>
<script type="text/javascript">
angular.service('title_changer', function($document) {
alert('title_changer service running');
<!doctype html>
<html xmlns:ng="http://angularjs.org">
<head>
<title>Angular Title Test</title>
<script src="http://code.angularjs.org/angular-0.9.10.min.js" ng:autobind></script>
<script type="text/javascript">
function LoadingController($resource) {
this.data = $resource('data.json').get();
}
LoadingController.$inject = ['$resource'];
<!doctype html>
<html xmlns:ng="http://angularjs.org">
<head>
<title>Angular Newline-In-Option Test</title>
<script src="http://code.angularjs.org/angular-0.9.10.min.js" ng:autobind></script>
</head>
<body ng:init='event={};sites=[{"id": "96b1a3ce-0b26-40df-8f5a-2017f5a7fcbd", "name": "Name Only"}, {"id": "983aea62-b6a7-4e0a-bde1-5c48eb3ad19e", "name": "Check Box Condition Only"}]'>
<p>With newlines inside the option node, fail:</p>
<select name="event.site1" id="location">
@arantius
arantius / angular-switch-comment.html
Created February 25, 2011 20:17
angular ng:switch + comment test case
<!DOCTYPE html>
<html xmlns:ng="http://angularjs.org">
<head>
<script type="text/javascript" ng:autobind src="http://code.angularjs.org/0.9.10/angular-0.9.10.js"></script>
</head>
<body ng:init="value='foo'">
<p>The ng:switch construct fails when one of its children is a comment.</p>
<p>Works (when the bug isn't triggered on the same page):</p>
@arantius
arantius / angular-select-keyboard.html
Created February 28, 2011 20:03
angular <select> keyboard test case
<!DOCTYPE html>
<html xmlns:ng="http://angularjs.org">
<head>
<script type="text/javascript" ng:autobind src="http://code.angularjs.org/0.9.10/angular-0.9.10.js"></script>
<script type="text/javascript">
function NullCtrl() {
this.trigger = 'alpha';
}
</script>
</head>
@arantius
arantius / Karma_Blocker_Default_Rules.ini
Created March 7, 2011 01:42
The default rules for a Karma Blocker installation.
# This is a ruleset configuration for Karma Blocker. For more information, see:
# http://trac.arantius.com/wiki/Extensions/KarmaBlocker
# This default ruleset is intended to be demonstrative: making productive
# use of all the features that the Karma Blocker rule syntax provides. It
# should generally work, but it has intentionally not been tweaked to deal
# with the particulars of any given site. All rules here are intended to
# explain what can be done, and how it can be done, while remaining as
# generic as possible, with limited exceptions. You the user are expected
# to tweak and customize these rules.
@arantius
arantius / app.yaml
Created March 21, 2011 19:58
angular .save() / .get() confusion test case
application: angular-resource-save-test
version: 1
runtime: python
api_version: 1
handlers:
- url: /
static_files: index.html
upload: index.html