Skip to content

Instantly share code, notes, and snippets.

View wisniewski94's full-sized avatar
🏇

Wiktor wisniewski94

🏇
View GitHub Profile
type Primitive = | null | undefined | string | number | boolean | symbol | bigint;
type LiteralUnion<LiteralType, BaseType extends Primitive,> = LiteralType | (BaseType & Record<never, never>);
export interface Shopify {
PaymentButton: {
init(): any
}
autoloadFeatures(param: any): any
/**
* Only show in Theme previews, it's a class instance, yuck.
@don
don / hexStringToArrayBuffer.js
Created May 3, 2018 17:54
Convert hex string to ArrayBuffer
/**
* Convert a hex string to an ArrayBuffer.
*
* @param {string} hexString - hex representation of bytes
* @return {ArrayBuffer} - The bytes in an ArrayBuffer.
*/
function hexStringToArrayBuffer(hexString) {
// remove the leading 0x
hexString = hexString.replace(/^0x/, '');
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 10, 2024 20:54
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

<html>
<head>
<script src="https://cdn.shopify.com/s/assets/external/pos_app.js"></script>
</head>
<body>
<script type="text/javascript">
ShopifyPOS.init({
apiKey: "0dc181105f1912f21b5de1a0ae64db37",
shopOrigin: "https://CURRENT_LOGGED_IN_SHOP.myshopify.com"
});
@garrettmac
garrettmac / custom.filter.buttons.tags.liquid
Last active March 15, 2023 00:10
Shopify Filter Snippets
Tag Filter:
<ul class="subnav clearfix">
<li{% unless current_tags %} class="active"{% endunless %}>
{% if collection.handle %}
<a href="/collections/{{ collection.handle }}{% if collection.sort_by %}?sort_by={{ collection.sort_by }}{% endif %}">All</a>
{% elsif collection.current_type %}
<a href="{{ collection.current_type | url_for_type | sort_by: collection.sort_by }}">All</a>
@ayamflow
ayamflow / gist:b602ab436ac9f05660d9c15190f4fd7b
Created May 9, 2016 19:10
Safari border-radius + overflow: hidden + CSS transform fix
// Add on element with overflow
-webkit-mask-image: -webkit-radial-gradient(white, black);
@gokulkrishh
gokulkrishh / media-query.css
Last active May 8, 2024 06:59
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@joshwyatt
joshwyatt / how_to_make_a_script.md
Last active January 22, 2024 20:41
How to make scripts you can access globally from the terminal

How to make a globally available executable script in the scripting language of your choice

  • Locate the path to the interpreter for the language you are writing in with the which command.

      which node
      which python
      which bash
      which ruby
    
  • Add that path as an interpreter directive (using #!) on the first line of your script. For example if you want to write a node script and which node returned /usr/local/bin/node, the first line of your script should be:

@codler
codler / css-supports.js
Last active October 8, 2022 09:32
CSS.supports() Polyfill
/*! CSS.supports() Polyfill
* https://gist.github.com/codler/03a0995195aa2859465f
* Copyright (c) 2014 Han Lin Yap http://yap.nu; MIT license */
if (!('CSS' in window)) {
window.CSS = {};
}
if (!('supports' in window.CSS)) {
window.CSS._cacheSupports = {};
window.CSS.supports = function(propertyName, value) {
<html>
<head><title>Canvas Delaunay Triangulation</title></head>
<body></body>
<script type="text/javascript">
var img = new Image();
img.onload = init;
img.src = './bg_10.jpg';
var display, source;
var points = [], drew = [];