Skip to content

Instantly share code, notes, and snippets.

@stvnrynlds
stvnrynlds / menus-api.liquid
Last active January 19, 2022 14:46
Shopify LinkList API Workaround
{%- layout none -%}
{%- assign listParams = request.path | replace: page.url, "" | remove: "/" | split: '+' -%}
{% if listParams != empty %}
{
{% for param in listParams -%}
{%- assign getList = linklists[param] -%}
{%- if getList != empty %}
"{{ param }}": [{% for level1 in getList.links %}{
"id": "{{ level1.title | handle }}-{{ forloop.index0 }}",
@paulirish
paulirish / readme.md
Last active April 2, 2024 20:18
resolving the proper location and line number through a console.log wrapper

console.log wrap resolving for your wrapped console logs

I've heard this before:

What I really get frustrated by is that I cannot wrap console.* and preserve line numbers

We enabled this in Chrome DevTools via blackboxing a bit ago.

If you blackbox the script file the contains the console log wrapper, the script location shown in the console will be corrected to the original source file and line number. Click, and the full source is looking longingly into your eyes.

@serby
serby / hotspot.js
Last active August 29, 2015 13:58
var krpano = $('#krpanoObject')[0]
, p = $('#krpanoObject')[0]
p.call('addhotspot("jim")')
p.set('hotspot["jim"].url', 'http://upload.wikimedia.org/wikipedia/en/e/e0/Black_Down_Arrow.png')
p.set('hotspot[jim].ath',150)
p.set('hotspot[jim].atv',15)
p.set('hotspot[jim].scale',0.4)
p.set('hotspot[jim].zoom',true)
@serby
serby / naming.md
Last active December 26, 2015 23:49

Clock JavaScript/JSON Naming Guide

Please ensure you are familiar with our JavaScript styleguide. This guide builds on top of that document and aims to advise on the semantic naming of variable, objects, properties, classes and functions.

Glossary

Object

From Mozilla's JavaScript Glossary

@SlexAxton
SlexAxton / .zshrc
Last active November 20, 2024 16:12
My gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
@max-mapper
max-mapper / blink-led.js
Last active April 13, 2022 20:30
raspberry pi scripts