Skip to content

Instantly share code, notes, and snippets.

🏍
💨💨💨💨💨💨

Brendan Falkowski brendanfalkowski

🏍
💨💨💨💨💨💨
Block or report user

Report or block brendanfalkowski

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View picturefill-1-to-picturefill-2-docs.html
<h1>PictureFill 2 Upgrade</h1>
<p>
Upgrading to PictureFill 2 lets us take advantage of native functionality in
modern browsers for responsive images. This is critical for performance
because it uses browser the preloader rather than waiting for JS to parse
the source. Older browsers will still work with JS, but with some limitations
because of the leaner fallback for modern browsers to work efficiently.
</p>
@brendanfalkowski
brendanfalkowski / gist:11240002
Created Apr 24, 2014
"sudo pip install ansible" fails
View gist:11240002
Requirement already satisfied (use --upgrade to upgrade): ansible in /Library/Python/2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): paramiko in /Library/Python/2.7/site-packages (from ansible)
Requirement already satisfied (use --upgrade to upgrade): jinja2 in /Library/Python/2.7/site-packages (from ansible)
Requirement already satisfied (use --upgrade to upgrade): PyYAML in /Library/Python/2.7/site-packages (from ansible)
Downloading/unpacking pycrypto>=2.1,!=2.4 (from paramiko->ansible)
Downloading pycrypto-2.6.1.tar.gz (446kB): 446kB downloaded
Running setup.py (path:/private/tmp/pip_build_root/pycrypto/setup.py) egg_info for package pycrypto
Downloading/unpacking ecdsa (from paramiko->ansible)
Downloading ecdsa-0.11.tar.gz (45kB): 45kB downloaded
@brendanfalkowski
brendanfalkowski / flex-centering.html
Created Mar 29, 2014
Vertical and horizontal centering with flexbox.
View flex-centering.html
<div class="xx">
<img src="http://placehold.it/1250x600" alt="#" />
<div class="yy">
<div class="zz">
Nulla facilisi. Duis aliquet egestas purus in blandit. Curabitur
vulputate, ligula lacinia scelerisque tempor, lacus lacus ornare
ante, ac egestas est urna sit amet arcu.
</div>
</div>
@brendanfalkowski
brendanfalkowski / flex-wrap.html
Created Mar 26, 2014
Example of multi-column RWD with flex-wrap.
View flex-wrap.html
<div class="flex-test">
<p class="flex-test-item">Nulla facilisi. Duis aliquet egestas purus in blandit. Curabitur vulputate, ligula lacinia scelerisque tempor.</p>
<p class="flex-test-item">Nulla facilisi. Duis aliquet egestas purus in blandit. Curabitur vulputate, ligula lacinia scelerisque tempor. ligula lacinia scelerisque tempor. ligula lacinia scelerisque tempor.</p>
<p class="flex-test-item">Nulla facilisi. Duis aliquet egestas purus in blandit. Curabitur vulputate, ligula lacinia scelerisque tempor.</p>
<p class="flex-test-item">Nulla facilisi. Duis aliquet egestas purus in blandit. Curabitur vulputate, ligula lacinia scelerisque tempor.</p>
</div>
<style>
.flex-test {
display:flex;
@brendanfalkowski
brendanfalkowski / fire-callback-on-click.js
Created Jan 25, 2014
Get "data-callback" attribute from markup, check if the function exists, and then call it.
View fire-callback-on-click.js
var elem = $('.selector');
elem.on('click', function (e) {
var callbackName = $(this).data('callback');
if ($.isFunction(window[callbackName])) {
window[callbackName].call(this);
}
});
@brendanfalkowski
brendanfalkowski / recursive-text-replace.sh
Last active Jan 25, 2016
Replace all occurrences of one string with another string in all child directories matching specific file types. Useful for normalizing Magento's copyright changes to get code-only diffs between releases.
View recursive-text-replace.sh
############################
# Basic usage
############################
cd path/to/project
# One file type:
# Replace "red rover" with "black dog" in PHP files
@brendanfalkowski
brendanfalkowski / monitor-then-duplicate.js
Created May 1, 2013
jQuery snippet to monitor an element for an element to appear in the DOM, then duplicate its contents into another element.
View monitor-then-duplicate.js
var cachedContentHtml = '';
window.setInterval(function() {
var watchElem = $('.watch-me');
// Check if "element" exists in DOM yet
if ( watchElem.length ) {
// Grab the content we need
var contentHtml = $('.content').html();
@brendanfalkowski
brendanfalkowski / toggle-next-sibling.js
Created Dec 7, 2011
onClick toggle the next sibling of an element
View toggle-next-sibling.js
function gravdept_next(elem) {
do {
elem = elem.nextSibling;
} while (elem && elem.nodeType != 1);
return elem;
}
function gravdept_toggle(elem) {
var nextElem = gravdept_next(elem);
@brendanfalkowski
brendanfalkowski / jquery_twitter_getRecent.js
Created May 4, 2011
Gets the most recent tweet and adds links
View jquery_twitter_getRecent.js
/* for Twitter JSON request */
function linkify (text) {
var exp = /(\b(https?|mailto):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
return text.replace(exp,"<a href='$1'>$1</a>");
}
/* jQuery start */
$(document).ready(function(){
You can’t perform that action at this time.