A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.
One-line version to paste in your DevTools
Use $$
if your browser aliases it:
~ 108 byte version
{%- comment -%} | |
Lazyload/Lazysizes responsive image snippet | |
Author: Eric Hayes | |
Version: 2.3 | |
------------------------------------- | |
Requires: | |
image: {Obect} image object setting variable | |
Accepts: |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> | |
{% assign found_title = false %} | |
{% for item in checkout.line_items %} | |
{% if item.variant.id == 7387208286253 %} | |
{% assign found_title = true %} | |
{% endif %} | |
{% endfor %} | |
{% if checkout.subtotal_price > 10000 and found_title == false %} | |
<script> |
// Inspired by https://twitter.com/coderitual/status/1112297299307384833 and https://tapajyoti-bose.medium.com/7-killer-one-liners-in-javascript-33db6798f5bf | |
// Remove any duplicates from an array of primitives. | |
const unique = [...new Set(arr)] | |
// Sleep in async functions. Use: await sleep(2000). | |
const sleep = (ms) => (new Promise(resolve => setTimeout(resolve, ms))); | |
// or | |
const sleep = util.promisify(setTimeout); |
function countdown(endDate) { | |
let days, hours, minutes, seconds; | |
endDate = new Date(endDate).getTime(); | |
if (isNaN(endDate)) { | |
return; | |
} | |
setInterval(calculate, 1000); |
// Add on element with overflow | |
-webkit-mask-image: -webkit-radial-gradient(white, black); |
{% layout none %}{% comment %} | |
/* | |
* Simple blog feed | |
* | |
* Copyright (c) 2015 Jason Bowman (jason@freakdesign.com.au) | |
* Licensed under the MIT license: | |
* http://www.opensource.org/licenses/mit-license.php | |
* | |
*/ | |
{% endcomment %}<?xml version="1.0" encoding="UTF-8"?> |
grunt.registerTask('default', function () { | |
var fs = require('fs'); | |
// my precommit hook is inside the repo as /hooks/pre-commit | |
// copy the hook file to the correct place in the .git directory | |
grunt.file.copy('hooks/pre-commit', '.git/hooks/pre-commit'); | |
// chmod the file to readable and executable by all | |
fs.chmodSync('.git/hooks/pre-commit', '755'); | |
}); |
/** | |
* Add Custom Content After All WordPress Posts By http://goo.gl/ht6fZo | |
*/ | |
function add_after_post_content($content) { | |
if(!is_feed() && !is_home() && is_singular() && is_main_query()) { | |
$content .= '<p>YOUR CONTENT AFTER POST</p>'; | |
} | |
return $content; | |
} | |
add_filter('the_content', 'add_after_post_content'); |
If you're a heavy user of the Twitter web client like me then you'll find the new inline preview feature extremely intrusive as it breaks up the timeline too much. If I wanted to use facebook or linkedin then I'd be using facebook or linkedin. Having said that, cards in Twitter are great and the ability to preview media before jumping off site is really cool - but it should be my choice, not have everything foisted on my timeline.
That the mobile client allows for this with a setting is even more annoying.
So here's the fix. This only works in Chrome but I'm sure an enterprising person could do something similar for Safari and Firefox using the same CSS. Pull requests to update instructions for other browsers are of course very welcome.