Skip to content

Instantly share code, notes, and snippets.

View viktmv's full-sized avatar
🇺🇦

Viktor viktmv

🇺🇦
  • Ottawa, ON
  • 23:06 (UTC -04:00)
  • X @viktmv
View GitHub Profile
@viktmv
viktmv / from_umlauts
Last active June 6, 2021 21:06
Unicode normalize from umlauts
const fromUmlaut = {
À: 'A', Á: 'A', Â: 'A', Ã: 'A', Ä: 'A', Å: 'A', Æ: 'A',
Ç: 'C',
È: 'E', É: 'E', Ê: 'E', Ë: 'E',
Ì: 'I', Í: 'I', Î: 'I', Ï: 'I',
Ð: 'D',
Ñ: 'N',
Ò: 'O', Ó: 'O', Ô: 'O', Õ: 'O', Ö: 'O', Ø: 'O',
Ù: 'U', Ú: 'U', Û: 'U', Ü: 'U',
Ý: 'Y',
import React, { Component } from 'react'
import { Image, StyleSheet } from 'react-native'
import { connect } from 'react-redux'
import SplashScreen from 'react-native-splash-screen'
import WithScreenGradient from '../components/WithScreenGradient'
import { updateAssets, liveUpdateAssets } from '../actions/assets'
import { setUser } from '../actions/users'
import { getActiveCurrency } from '../actions/currencies'
@viktmv
viktmv / csv_formatter.ex
Created January 9, 2019 15:20
main part of the csv formatter util
defmodule CsvFormatter do
def format(file_name) do
{_data, formatted_rows} =
decode(file_name)
|> Enum.map(&format_entry/1)
|> Enum.map_reduce([], &reduce_to_rows/2)
write(formatted_rows)
end

Keybase proof

I hereby claim:

  • I am viktmv on github.
  • I am viktmv (https://keybase.io/viktmv) on keybase.
  • I have a public key ASD9YxleTePLLZHsY_-Rml_MW2Lh8xn9_ucYNaF4w6qRZwo

To claim this, I am signing this object:

@viktmv
viktmv / promiseWrapper.js
Last active July 2, 2022 14:56
Google App Script Promise.all wrapper for google.script.run
// Load all async functions in one place using google.script.run wrapped in Promise.all
// Function takes array of function names (as strings) and returns an array of resolved promises
const loadAll = fncs => {
return Promise
.all(fncs.map(fn => new Promise(res =>
google.script.run.withSuccessHandler(data => res(data))[fn]()
))
)
}
(function() {
"use strict"
// helper
let $ = (selector) => document.body.querySelector(selector)
// Main Navigation between three sections
let shoppingCart = $(".shopping-cart")