Skip to content

Instantly share code, notes, and snippets.

/*
* This other bot is helping-- somewhat.
*/
this.on('start', function() {
var directions = {
/*
* Open all three doors to exit.
*
* The answer is 5.
*/
this.on('start', function() {
var directions = {
top: function() {
@uadev
uadev / bitsquest.level.10.js
Created January 14, 2014 00:39
It's easy when you can create a map.
/*
* Do it.
*
*/
this.on('start', function() {
var directions = {
top: function() {
this.thrusters.bottom(true);
@uadev
uadev / bitsquest.level.11.js
Created January 14, 2014 00:49
This will work... after several iterations.
/*
* Open all three doors to exit.
*
* The answer is ?.
*/
/*
* Do it.
*
*/
@uadev
uadev / bitquest.level.12.js
Created January 14, 2014 01:11
Radar instead sensor. No changes to framework.
/*
* Do it.
*
*/
this.on('start', function() {
var directions = {
top: function() {
this.thrusters.bottom(true);
@uadev
uadev / github-generate-notes.js
Last active August 29, 2015 14:11
Generate Release Notes from compare view
function getNotes() {
Array.prototype.map.call(
document.querySelectorAll('.comment-body > p'),
function(c) { return '\\' + c.innerHTML}
).join("\n")
};
@uadev
uadev / add-copy-tab.js
Last active August 29, 2015 14:11
Github create a Release Notes copy Button
/** @global ZeroClipboard **/
function addTab(text) {
var li = document.createElement('li');
li.classList.add('tabnav-tab');
li.innerText = 'Copy Notes';
li.style.cursor = 'pointer';
var c = new ZeroClipboard(li);
c.on('copy', function(e) {
e.clipboardData.setData('text/plain', text);
li.innerHTML = 'Notes <small><b>(copied)<b></small>';
@uadev
uadev / github-release-notes-bookmarklet.src.js
Last active August 29, 2015 14:11
Complete Bookmarklet for GitHub release notes
/** @global ZeroClipboard **/
function addTab(text) {
var li = document.createElement('li');
var c = new ZeroClipboard(li);
c.on('copy', function(e) {
e.clipboardData.setData('text/plain', text);
li.innerHTML = 'Notes <small><b>(copied)<b></small>';
});
li.classList.add('tabnav-tab');
li.innerText = 'Copy Notes';
<a href="javascript:(function()%7Bfunction addTab(text) %7Bvar li %3D document.createElement('li')%3Bvar c %3D new ZeroClipboard(li)%3Bc.on('copy'%2C function(e) %7Be.clipboardData.setData('text%2Fplain'%2C text)%3Bli.innerHTML %3D 'Notes <small><b>(copied)<b><%2Fsmall>'%3B%7D)%3Bli.classList.add('tabnav-tab')%3Bli.innerText %3D 'Copy Notes'%3Bli.style.cursor %3D 'pointer'%3Bdocument.querySelector('.tabnav-tabs').appendChild(li)%3B%7D%3Bfunction getNotes() %7Breturn Array.prototype.map.call(document.querySelectorAll('.comment-body > p')%2Cfunction(c) %7Breturn '%5C%5C' %2B c.innerHTML%3B%7D).join("%5Cn")%7D%3BaddTab(getNotes())%7D)()">Get Release Notes</a>
@uadev
uadev / data.js
Last active August 29, 2015 14:11
Quick dataset function
var dataset = function initDataSet() {
if (document.documentElement.dataset) {
return function native(el, prop, value) {
if (typeof value === 'undefined') {
return el.dataset[prop] = value;
}
else {
return el.dataset[prop];
}
}