Skip to content

Instantly share code, notes, and snippets.

// ==UserScript==
// @name eval test
// @include *
// ==/UserScript==
eval("alert('eval test')")
alert("Relative @require works!");
// ==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>