Skip to content

Instantly share code, notes, and snippets.

View shepelevstas's full-sized avatar
😁

Shepelev Stas shepelevstas

😁
  • Russia, Krasnoyarsk
View GitHub Profile
@shepelevstas
shepelevstas / settings.json
Created September 6, 2020 18:50
vscode solarized dark custom adjustments
{
"workbench.settings.openDefaultSettings": false,
"workbench.settings.openDefaultKeybindings": true,
"editor.fontFamily": "menlo, dejavu sans code hinted, hackmen, jetbrains mono, fira code, consolas, hasklig, iosevka ss04, courier new",
"editor.fontLigatures": true,
"window.zoomLevel": -1,
"editor.fontSize": 17,
"editor.lineHeight": 26,
"terminal.integrated.fontSize": 17,
"editor.letterSpacing": -0.5,
@shepelevstas
shepelevstas / locked_aspect_ratio_block.css
Last active September 15, 2020 09:40
css block with fixed aspect ratio
.fixed-ratio-block {
position: relative;
}
.fixed-ratio-block:before {
content: '';
display: block;
padding-top: 80%;
}
.fixed-ratio-block__content {
position: absolute;
@shepelevstas
shepelevstas / Main.elm
Created April 15, 2021 21:59
Recursive widgets rendering from son
module Main exposing (main)
import Browser
import Html exposing (Html, button, div, text, input, label, button)
import Html.Attributes exposing (type_, class, value, name, checked)
import Html.Events exposing (onClick)
type alias Model =
{ count : Int, fields: List Field }
@shepelevstas
shepelevstas / settings.json
Last active September 2, 2021 17:01
Emerald VS Code Color Theme
{
"workbench.colorCustomizations": {
"[Visual Studio Dark]": {
// Emerald 028a0f
// Pistachio b2d3c2
// Fern 5dbb63
// Parakeet 03c04a
"editor.background": "#5dbb63",
"editor.foreground": "#fffc",
"editorIndentGuide.background": "#0001",
@shepelevstas
shepelevstas / onVisible.js
Created April 7, 2022 10:47
html element becomes visible
function onVisible(el, once=true) {
return new Promise((done, fail) => {
new IntersectionObserver((entries, observer) => {
entries.forEach(entry => {
if (entry.intersectionRatio > 0) {
done(el, observer, entry)
if (once) {observer.disconnect()}
}
})
}).observe(el)
@shepelevstas
shepelevstas / counter.html
Created April 8, 2022 06:57
counter up to big int
<script>
;window.addEventListener('load', () => {
/// пример <span data-count-from='0' data-count-to='8000000' data-count-duration='2000'>8.000.000</span>
function onceVisible(el, callback) {
new IntersectionObserver((entries, observer) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
callback(el, entry, observer)
observer.disconnect()
}
@shepelevstas
shepelevstas / Main.elm
Last active July 19, 2022 12:45
Kadr widget
module Main exposing (main)
import Browser
import Browser.Events as Events
import Browser.Dom as Dom
import Html exposing (Html, button, div, text)
import Html.Attributes exposing (class, style, id)
import Html.Events exposing (onClick)
import Html.Events.Extra.Mouse as Mouse
import Json.Decode as D
from django.db.models import Sum
from .models import Item
# for django < 1.8
group_sums = Item.objects.filter(deleted=None).values('user').annotate(sum=Sum('price', field='price*quantity'))
# group_sums :: [{'user': 123, 'sum': 9999}]
# values + annotate => GROUP BY in sql
@shepelevstas
shepelevstas / settings.json
Created August 3, 2022 17:18
Vscode light theme Codepen
{
"workbench.colorCustomizations": {
"[Default Light+]": {
"panel.background": "#eee",
"terminal.background": "#fff",
"editorPane.background": "#eee",
"editorGutter.background": "#eee",
"editorGroupHeader.noTabsBackground": "#eee",
"list.inactiveSelectionBackground": "#cde",
"sideBar.border": "#ccc",
"workbench.colorCustomizations": {
"[Eiffel]": {
"editorGroupHeader.noTabsBackground": "#eee",
},
},
"editor.tokenColorCustomizations": {
"[Eiffel]": {"textMateRules": [
{"settings":{"foreground":"#000"},"scope":[
"invalid.illegal.unrecognized-tag.html",