Skip to content

Instantly share code, notes, and snippets.

View ryanw3b3r's full-sized avatar
💪
Having a very productive day

Ryan W ryanw3b3r

💪
Having a very productive day
View GitHub Profile
@pie6k
pie6k / widget.js
Created January 3, 2023 23:37
Scriptable widget showing app revenue
// Copy this code and paste it into Scriptable code editor on your phone
async function loadStats() {
const request = new Request("https://your-endpoint-giving-you-revenue-data.com");
const { todayUSD, todayOrders, revenue30USD, orders30 } = await request.loadJSON();
return { todayUSD, todayOrders, revenue30USD, orders30 };
}
const usdFormatter = new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" });
@hailwood
hailwood / AlternateMailerServiceProvider.php
Created September 25, 2019 01:56
Laravel Alternative Mailer
<?php
namespace App\Services\AlternateMailer;
use Illuminate\Mail\Mailer;
use Swift_Mailer;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use Swift_DependencyContainer;
use Illuminate\Support\ServiceProvider;
@reinink
reinink / DateInput.vue
Created August 27, 2019 11:51
Pikaday Vue Component
<template>
<div>
<label v-if="label" class="form-label" :for="`date-input-${_uid}`">{{ label }}:</label>
<input v-bind="$attrs" class="form-input" :id="`date-input-${_uid}`" :class="{ error: error }" type="text" ref="input" :value="value" @change="change" @keyup="change">
<div v-if="error" class="form-error">{{ error }}</div>
</div>
</template>
<script>
import pikaday from 'pikaday'
@adamwathan
adamwathan / v-cloak.md
Last active February 26, 2023 14:26
Useful CSS utilities for Vue.js cloaking

Handy helpers for controlling visibility of elements until Vue has compiled.

Use like:

<div v-cloak>
  <h1>
    <span class="v-cloak--inline">Loading...</span> <!-- Only displayed before compiling -->
    <span class="v-cloak--hidden">{{ post.title }}</span> <!-- Hidden until compiling is finished -->
 
@dinhkhanh
dinhkhanh / change-dropdown-attribute-to-multiselect.sql
Last active April 17, 2020 09:23
Magento change dropdown attribute to multiselect
-- First, update the attribute input type to multiselect
UPDATE eav_attribute SET
entity_type_id = 4,
attribute_model = NULL,
backend_model = 'eav/entity_attribute_backend_array',
backend_type = 'varchar',
backend_table = NULL,
frontend_model = NULL,
frontend_input = 'multiselect',
frontend_class = NULL
[
{
"command": "escape"
},
{
"command": "expand_selection",
"args": {"to": "word"}
},
{
"command": "copy"