Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
/* Copyright (c) 2011 Aza Raskin | |
| | |
| Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | |
| documentation files (the "Software"), to deal in the Software without restriction, including | |
| without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is furnished to do so, subject | |
| to the following conditions: | |
| | |
| The above copyright notice and this permission notice shall be included in all copies or substantial portions | |
| of the Software. |
(function () { | |
// IndexedDB | |
var indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB || window.OIndexedDB || window.msIndexedDB, | |
IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction || window.OIDBTransaction || window.msIDBTransaction, | |
dbVersion = 1.0; | |
// Create/open database | |
var request = indexedDB.open("elephantFiles", dbVersion), | |
db, | |
createObjectStore = function (dataBase) { |
/** | |
* Enable route to __noSuchMethod__ when unknown method calling. | |
* | |
* @param {Object} obj Target object. | |
* @return {Object} | |
*/ | |
function enableMethodMissing(obj) { | |
var functionHandler = createBaseHandler({}); | |
functionHandler.get = function(receiver, name) { |
/** | |
Workaround for iOS 6 setTimeout bug using requestAnimationFrame to simulate timers during Touch/Gesture-based events | |
Author: Jack Pattishall (jpattishall@gmail.com) | |
This code is free to use anywhere (MIT, etc.) | |
Note: UIWebView does not support requestAnimationFrames. If your timer is failing during a scroll event, | |
take a look at https://gist.github.com/ronkorving/3755461 for a potential workaround. | |
Usage: Pass TRUE as the final argument for setTimeout or setInterval. |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
Reusing an AngularJS Directive core code. The idea is to: | |
** 1. conceal the actual directive behaviour in a separate JS "class", | |
** 2. store that in an Angular service, | |
** 3. inject that service into an Angular directive, | |
** 4. just have the directive factory function return the constructed instance of the "class". | |
That is to separate the directive core code from the actual directive factory. | |
Then one actually wants to inherit a directive core "class" from another. It's not really a matter of JS inheritance, but more on how to inject one into the other by means of Angular modules, without actually instantiating none of them until needed, |
⇐ back to the gist-blog at jrw.fi
First there was JSLint, and there was much rejoicing. The odd little language called JavaScript finally had some static code analysis tooling to go with its many quirks and surprising edge cases. But people gradually became annoyed with having to lint their code according to the rules dictated by Douglas Crockford, instead of their own.
So JSLint got forked into JSHint, and there was much rejoicing. You could set it up to only complain about the things you didn't want to allow in your project, and shut up about the rest. JSHint has been the de-facto standard JavaScript linter for a long while, and continues to do so. Yet there will always be things your linter could check for you, but doesn't: your team has agreed on some convention that makes sense for them, but JSHint doesn't have an option
%lex | |
%{ | |
var parser = yy.parser; | |
%} | |
%% | |
\n return 'NEWLINE' | |
\s+ /* skip whitespace */ |
This should be one of the core features of Git, but for some reason it's impossible to figure out how to search for a string in your commit history and see the diffs that that string is in. Here's the best I've come up with:
To find which commits and which files a string was added or removed in:
git log -S'search string' --oneline --name-status
To see the diff of that