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 / 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