This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from 'vue'; | |
/** | |
* EventHub to listen or broadcast to all components | |
* | |
* @see https://shopify.dev/tutorials/develop-theme-sections-integration-with-theme-editor | |
* | |
* Usage: eventHub.$on('shopify:section:select:{my-section-name}', (event) => handleSelect()); | |
* | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl --connect-timeout 15 -v --insecure "smtp://smtp.example.com:25" -u "username:password" | |
\ --mail-from "sender@example.com" --mail-rcpt "destination@example.com" | |
\ -T email-contents.txt --ssl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="pagination size1of1 unit"> | |
<?php if($paged == 1): ?> | |
<span class="current"><?php echo $paged ?></span> | |
<?php else: ?> | |
<a class="prev" href="?page=<?php echo ($current_page - 1) ?>">Prev</a> | |
<?php if ($current_page > 2): ?> | |
<a href="?page=1">1</a> | |
<?php endif ?> | |
<?php if ($current_page > 3): ?> | |
<span class="dots">...</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Simple JavaScript Templating | |
// John Resig - http://ejohn.org/ - MIT Licensed | |
(function(){ | |
var cache = {}; | |
this.tmpl = function tmpl(str, data){ | |
// Figure out if we're getting a template, or if we need to | |
// load the template - and be sure to cache the result. | |
var fn = !/\W/.test(str) ? | |
cache[str] = cache[str] || |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# idea from https://www.devside.net/wamp-server/load-testing-apache-with-ab-apache-bench | |
# if you are testing a base url, you need a trailing slash | |
SITE="http://example.com/" | |
OUTFILE="output.txt" | |
DIVIDER="\n====================================================================\n" | |
# if the file doesnt exist, make it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
$.getStylesheet = function (href) { | |
var $d = $.Deferred(); | |
var $link = $('<link/>', { | |
rel: 'stylesheet', | |
type: 'text/css', | |
href: href | |
}).appendTo('head'); | |
$d.resolve($link); | |
return $d.promise(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get all the link files with timestamp caches | |
Array.from(document.querySelectorAll('link[href*="?t="]')).forEach(el => { | |
// replace the href with a new one with a refreshed cache stamp | |
el.href = el.href.replace(/(?:t=)(\d+)/, 't=' + Date.now()); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Required parameters: | |
# @raycast.schemaVersion 1 | |
# @raycast.title Search on Kagi | |
# @raycast.mode compact | |
# @raycast.argument1 { "type": "text", "placeholder": "query", "percentEncoded": true } | |
# Optional parameters: | |
# @raycast.icon images/icon-kagi.png |