Skip to content

Instantly share code, notes, and snippets.

Alexander Kurganov Akurganow

Block or report user

Report or block Akurganow

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View whiteboardCleaner.md

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2

Results

View svg-icon.coffee
path = require 'path'
fs = require 'fs'
fixedEncodeURIComponent = (str) ->
encodeURIComponent(str).replace(/[!'()*]/g, (c) ->
'%' + c.charCodeAt(0).toString(16)
)
injectColor = (svg, color) ->
svg.replace(/<svg[^>]*>/, "$&<style>*{fill:#{ color }}</style>")
View PostCSS plugins.md
  • postcss-import — PostCSS plugin to transform @import rules by inlining content.
  • postcss-nested — PostCSS plugin to unwrap nested rules like how Sass does it.
  • postcss-for — PostCSS plugin that enables @for loop syntax in your CSS.
  • postcss-css-variables — PostCSS plugin to transform CSS Custom Properties (CSS variables) syntax into a static representation.
  • postcss-custom-media — PostCSS plugin to transform W3C CSS Custom Media Queries syntax to more compatible CSS.
  • postcss-inline-svg — PostCSS plugin to reference an SVG file and control its attributes with CSS syntax.
  • postcss-assets — PostCSS Assets is an asset manager for CSS.
  • [postcss-brand-colors](https://gi
View style-preload.js
var sp = [].slice.apply(document.querySelectorAll('link[rel=preload][as=style]'))
sp.forEach(function(item) {
item.onload = function() {
item.rel = 'stylesheet'
item.onload = null
}
})
/**
View keybase.md

Keybase proof

I hereby claim:

  • I am akurganow on github.
  • I am akurganow (https://keybase.io/akurganow) on keybase.
  • I have a public key whose fingerprint is EAC9 F021 B881 9CEF 576B 182B D215 37C0 ABDF 1A9F

To claim this, I am signing this object:

@Akurganow
Akurganow / storages.ts
Last active Aug 14, 2019
usePersistedState
View storages.ts
export interface Storage {
getItem: (key: string) => string | null
setItem: (key: string, value: string) => void
removeItem: (key: string) => void
}
const fallback: Storage = {
getItem: (key: string): string | null => {
console.log(`This is fallback key "${key}" cannot be readed`)
You can’t perform that action at this time.