View fileInput.css
.fileContainer {
overflow: hidden;
position: relative;
}
.fileContainer [type=file] {
cursor: inherit;
display: block;
font-size: 999px;
filter: alpha(opacity=0);
View occluder.js
function occluder(){
var fresh = true;
var item = 40;
var offset = 0;
var scroller = window;
var viewport = 0;
return {
scroller : function scrollerConfig( el, init, context ){
if( arguments.length < 2 || !init || fresh ){
View weil.js
export default iterator =>
function * (cursor) {
while(cursor = iterator(cursor))
cursor = yield(cursor)
}
}
View patchinko.js
export {patch, scope}
function patch(a, b){
for(var key in b)
if(b.hasOwnProperty(key))
a[key] = (
b[key] instanceof scope
? scope.apply(a[key])
: b[key]
)
View range_selection_caret.js
dom.focus()
const range = document.createRange()
range.setStart(selection.anchorNode.nextSibling.nextSibling, 0)
range.collapse(true)
selection.removeAllRanges()
selection.addRange(range)
View jquery.whichclick.js
void function whichClickClosure( $ ){
var events = {
1 : 'leftclick',
2 : 'middleclick',
3 : 'rightclick'
},
// List of interruption events for symbolic linking between custom and native events
interrupts = [
'preventDefault',
'stopPropagation',
View package.json
{
"scripts": {
"start": "server.js"
}
}
View Spanner.jsx
export default const Spanner = ({ children = '', split = /\b/ }) =>
<span className="spanner">
{[].concat(children).map(string =>
string.split(split).map(substring =>
<span className={/^\s*$/.test(substring) ? 'whitespace' : 'word'}>
{substring}
</span>
)
)}
</span>
View unfuckReact.js
const mounted = new WeakSet()
export default const unfucker = (component, displayName = component.displayName || component.name || 'React.Component') => {
const host = {
[displayName] : class extends React.Component {
constructor(){
this.state = {}
component.apply(this, arguments)
}
View README.md

jquery.scrollLock.js

Useful for when a blocking user experience is needed (in my case, didn't want people unwittingly loosing their place by scrolling while a modal required their attention): $.scrollLock() locks the body in place, preventing scroll until it is unlocked.

// Locks the page if it's currently unlocked
$.scrollLock();

// ...or vice versa