Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View dexcell's full-sized avatar
🐱
building saas

Erick dexcell

🐱
building saas
View GitHub Profile
@dexcell
dexcell / BaseInput.vue
Created April 21, 2021 19:28
Vue.js component transparent wrapper https://youtu.be/7YZ5DwlLSt8?t=1304
<template>
<label>
{{ label }}
<input
v-bind="$attrs"
:value="value"
v-on="listeners"
>
</label>
</template>
Number of tokens within an yVault is calculated for the first time by
[number of token outside of yVault] / [factor] = [number of token within yVault]
Then the number inside the yVault is updated by simple multiplication by a multiplication factor:
[old number of token outside of yVault] * [factor] = [new number of token within yVault]
Since old number doesn't change, and only the factor does, it is enough to compare the % difference between two factors over different lengths to get the % change of the investment.
(500 * 10 = 5000) ,500 * (10*10%=11) = 550 [= 500*10%]
@dexcell
dexcell / gist:80b1449c56e9781419b583235bde5778
Last active April 15, 2023 12:35
ios simulator valet SSL certificate
- Open ~/.config/valet/CA
- Open safari. Open any webpage (e.g google.com).
- Drag LaravelValetCASelfSigned.pem to simulator. Click install profile.
- Open Setting -> General -> Profile and install profile
- Open Settings -> General -> About -> Certificate Trust Settings and Enable profile
@dexcell
dexcell / stacked_modal.js
Created February 26, 2020 17:14
Bootstrap 4 Stacked Modal
$('.modal').on('show.bs.modal', function () {
var $modal = $(this);
var baseZIndex = 1050;
var modalZIndex = baseZIndex + ($('.modal.show').length * 20);
var backdropZIndex = modalZIndex - 10;
$modal.css('z-index', modalZIndex).css('overflow', 'auto');
$('.modal-backdrop.show:last').css('z-index', backdropZIndex);
});
$('.modal').on('shown.bs.modal', function () {
var baseBackdropZIndex = 1040;
@dexcell
dexcell / pagination_example.sql
Created December 30, 2017 03:29 — forked from ssokolow/pagination_example.sql
Reasonably efficient pagination without OFFSET (SQLite version)
-- Reasonably efficient pagination without OFFSET
-- SQLite version (Adapted from MS SQL syntax)
-- Source: http://www.phpbuilder.com/board/showpost.php?p=10376515&postcount=6
SELECT foo, bar, baz, quux FROM table
WHERE oid NOT IN ( SELECT oid FROM table
ORDER BY title ASC LIMIT 50 )
ORDER BY title ASC LIMIT 10