This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Spoiler hider | |
// @description Hide spoilers on the page without the subreddit theme | |
// @author Chris Montrois | |
// @include *reddit.com/r/diablo/ | |
// @version 1.0 | |
// ==/UserScript== | |
// A function that loads jQuery and calls a callback function when jQuery has finished loading | |
function addJQuery(callback) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define("F2.BaseAppClass", ["F2.Events", "F2.Defer"], function(events, defer) { | |
var AppClass = function() {}; | |
// Init function that will be called by F2 automatically | |
// You probably don't want to override this, but you can | |
AppClass.prototype.init = function(appId, instanceId, context) { | |
var self = this; | |
this.appId = appId; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// AppClass | |
define("com_markit_header", ["F2.Defer", "F2", "MyCoolClass"], function(defer, F2) { | |
var AppClass = function() {}; | |
return AppClass; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Inside F2 library | |
// -------------------------------------------------------------------------------- | |
// Override "define" to give us the appId inside the plugin | |
var oldDefine = define; | |
define = function(id, deps, fn) { | |
// Append the appId to the dependency | |
if (deps && deps instanceof Array) { | |
for (var i = 0; i < deps.length; i++) { | |
if (deps[i].indexOf('F2Sandbox!') === 0) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Goals for sandboxing: | |
- Prevent "F2.Events.emit = function() { }" hijacking | |
- Apps can sandbox themselves without the container | |
- Sandboxing is optional | |
- Sandboxed apps can emit global events | |
- Apps can be sandboxed with any app from any domain |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Summary | |
In this example, each app gets its own instance of F2. Every instance of F2 | |
will share all the same page events. This setup will allow each app to add its | |
own plugins without interfering with the rest of the apps. | |
We'll add internal checks to make sure events are only broadcast to "trusted" | |
apps. This should allow any app to specify any other app on the page | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var F2Class = function() { | |
return { | |
emit: function(name, data) { | |
console.log("Safe and sound"); | |
} | |
}; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible | |
filetype off | |
filetype plugin indent off | |
" ----------------------------------------------------------------------------- | |
" Plugins | |
" ----------------------------------------------------------------------------- | |
" Set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/vundle.vim/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Component = React.createClass({ | |
contextTypes: { | |
router: React.PropTypes.func | |
}, | |
propTypes: { | |
isCool: React.PropTypes.bool | |
}, | |
getDefaultProps() { | |
return { | |
isCool: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
</head> | |
<body> | |
<div id="output_h"></div> | |
<div id="output_v"></div> | |
<script src="virtual-dom.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.0.5/handlebars.min.js"></script> |
OlderNewer