Skip to content

Instantly share code, notes, and snippets.

Enter;
yarn upgrade my-package@^
To get an interactive version picker
class TickTimer = {
constructor() {
this.tickMs = 6000
this.sound = new Audio("data:audio/wav;base64,//uQRAAAAWMSLwUIYAAsYkXgoQwAEaYLWfkWgAI0wWs/ItAAAGDgYtAgAyN+QWaAAihwMWm4G8QQRDiMcCBcH3Cc+CDv/7xA4Tvh9Rz/y8QADBwMWgQAZG/ILNAARQ4GLTcDeIIIhxGOBAuD7hOfBB3/94gcJ3w+o5/5eIAIAAAVwWgQAVQ2ORaIQwEMAJiDg95G4nQL7mQVWI6GwRcfsZAcsKkJvxgxEjzFUgfHoSQ9Qq7KNwqHwuB13MA4a1q/DmBrHgPcmjiGoh//EwC5nGPEmS4RcfkVKOhJf+WOgoxJclFz3kgn//dBA+ya1GhurNn8zb//9NNutNuhz31f////9vt///z+IdAEAAAK4LQIAKobHItEIYCGAExBwe8jcToF9zIKrEdDYIuP2MgOWFSE34wYiR5iqQPj0JIeoVdlG4VD4XA67mAcNa1fhzA1jwHuTRxDUQ//iYBczjHiTJcIuPyKlHQkv/LHQUYkuSi57yQT//uggfZNajQ3Vmz+Zt//+mm3Wm3Q576v////+32///5/EOgAAADVghQAAAAA//uQZAUAB1WI0PZugAAAAAoQwAAAEk3nRd2qAAAAACiDgAAAAAAABCqEEQRLCgwpBGMlJkIz8jKhGvj4k6jzRnqasNKIeoh5gI7BJaC1A1AoNBjJgbyApVS4IDlZgDU5WUAxEKDNmmALHzZp0Fkz1FMTmGFl1FMEyodIavcCAUHDWrKAIA4aa2oCgILEBupZgHvAhEBcZ6joQBxS76AgccrFlczBvKLC0QI2cBoCFvfTDAo7eoOQInqDPBtvrDEZBNYN5xwNwxQRfw8ZQ5wQVLvO8OYU+mHvFLlDh05Mdg7BT6YrRPpCBznMB2r//xKJjyyOh+cImr2/4doscwD6neZjuZR4AgAABYAAA
setInterval(
function() {
try {
var page = document.getElementById('page')
page.className = page.className.replace("dgd_blur", '');
document.querySelector(".dgd_overlay").remove();
} catch(ex) {
}
},
@yuchant
yuchant / Contract Killer 3.md
Last active July 20, 2016 23:02
The latest version of my ‘killer contract’ for web designers and developers
We couldn’t find that file to show.
@yuchant
yuchant / shopify-cart-options.liquid
Created March 29, 2016 18:09
Shopify Iterate over options in cart
<div class="cart__options">
{% for i in (0..2) %}
{% assign variant_option_key = i | plus: 1 | prepend: "option" %}
{% assign variant_value = item.variant[variant_option_key] %}
{% if variant_value %}
<div class="cart__option">
{{ item.product.options[i] }}: {{ variant_value }}
</div>
{% endif %}
{% endfor %}
@yuchant
yuchant / 0_reuse_code.js
Created August 13, 2014 05:51
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
def pull_down_remote_db():
""" Export database and files.
"""
local_db_dump_path = os.path.join(PROJECT_ROOT, 'remote_db_dump/auto_db_dump.sql')
with settings(sudo_user='postgres'):
with cd('/var/lib/postgresql'):
run('pwd')
print("Dumping database on remote..")
sudo('pg_dump db_krownlab > auto_db_dump.sql')
var fitPhotoTargetSelector = name + " .fittingbox-fitphoto-target";
window.fitPhoto = FitPhoto.create(fitPhotoTargetSelector, {
width: 327,
glassID: glassID,
localeChain: 'en_US'
});
// handle change sku
$actionContainer.find('.fittingbox-sku').unbind('click').click(function() {
var sku = $(this).data('sku');
# custom validation logic
$.validator.addMethod 'validateShipState', (value, element) ->
# if the element contains an arbitrary piece of data called `custom-validator-exception`, don't allow form to validate.
if $(element).data('custom-validator-exception')
return false
return true
, ->
return $("[name=s_state]").data('custom-validator-exception')
<link href="/static/css/select2.css" type="text/css" media="screen" rel="stylesheet" />
<script type="text/javascript" src="/static/js/select2.js"></script>
<script type="text/javascript">
$(function () {
select2Options = {
'width': 'resolve',
}
$("#content-main select:not(.select2-offscreen)").select2(select2Options);