Skip to content

Instantly share code, notes, and snippets.

View ivanbanov's full-sized avatar
:octocat:
undefined

Ivan Banov ivanbanov

:octocat:
undefined
View GitHub Profile
const {htmlTagNames} = require('html-tag-names')
// get a list of all known html tag names and convert it into a map example:
// {body: true, head: true, li: true, h1: true, p: true} and so on
const tags = htmlTagNames.reduce((res, tag) => {
res[tag] = true
return res
}, {})
@roginfarrer
roginfarrer / nestedGlobalStyle.ts
Last active June 23, 2023 08:43
nested selectors for vanilla extract globalStyle
import { globalStyle, GlobalStyleRule } from "@vanilla-extract/css";
interface RecursiveGlobalStyle {
[k: string]: GlobalStyleRule | RecursiveGlobalStyle;
}
function globalUtil(selector: string, styles: RecursiveGlobalStyle) {
const write = (
key: string[],
value: RecursiveGlobalStyle | GlobalStyleRule
@yoosuf
yoosuf / stopnremoveall.sh
Created August 14, 2019 01:48
Stop and remove all docker containers and images (Docker)
# List all containers (only IDs)
docker ps -aq
# Stop all running containers
docker stop $(docker ps -aq)
# Remove all containers
docker rm $(docker ps -aq)
# Remove all images
const fs = require("fs");
const childProcess = require("child_process");
childProcess.exec("./node_modules/.bin/elm-analyse", (e, out) => {
let file;
let all = {};
for (let line of out.split("\n")) {
if (line.startsWith("-")) {
file = line.slice(2);
continue;
@canhnt
canhnt / git-delete-local-tag.sh
Created August 9, 2017 09:11
Delete local tags that do not exist in remote
git fetch --prune origin "+refs/tags/*:refs/tags/*"
@sabine
sabine / Templates.elm
Last active December 12, 2017 19:10
SVG spritesheet builder snippet (using svgstore + SVGO) for use with Elm
import Svg
import Svg.Attributes as SvgA
import SVGSprites
icon : Types.Taco -> (SVGSprites.Sprites -> String) -> List (Svg.Attribute msg) -> Html msg
icon taco name attrs =
Svg.svg
attrs
[ Svg.use [ SvgA.xlinkHref (taco.staticUrl ++ "icons/sprites.svg#" ++ (name SVGSprites.sprites)) ] []
]
module Child exposing (init, update, Message(InterestingMessage))
init = 0
type Message
= InterestingMessage
| InternalMessage
update message model = model

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by
module Json.Decode.Generic where
import Json.Decode as Decode exposing (Decoder, (:=))
import Array exposing (Array)
import Dict exposing (Dict)
type JsonValue = JsonNull
| JsonBool Bool
| JsonString String
| JsonFloat Float
@Falconerd
Falconerd / gulpfile.js
Last active April 10, 2019 17:16
Gulp + Watchify + Babelify + BrowserSync
/**
* This gulpfile will copy static libraries and a index.html file as well as
* merge, babelify and uglify the rest of the javascript project.
*
* TODO:
* - Separate media, libs and src with different watchers.
* - Media and libs should only be copied to dist if they are different sizes.
*
* The expected project is to be laid out as such:
*