Skip to content

Instantly share code, notes, and snippets.

View kuznero's full-sized avatar

Roman Kuznetsov kuznero

View GitHub Profile

Setting up Webpack for any Typescript project from Scratch

Welcome to step by step hands-on guide to setup webpack in your upcoming typescript project. Please follow the steps and you should be able to create your own webpack project. Please download the source code from github.

You will learn below things:

  1. ✅Create a Typescript node.js project.
  2. ✅Install Dependencies with webpack & typescripts.
  3. ✅Use Webpack CLI to crate webpack.config.js file and modify webpack.config.js based on our need.

Setting up Webpack for any Typescript project from Scratch

Welcome to step by step hands-on guide to setup webpack in your upcoming typescript project. Please follow the steps and you should be able to create your own webpack project. Please download the source code from github.

You will learn below things:

  1. ✅Create a Typescript node.js project.
  2. ✅Install Dependencies with webpack & typescripts.
  3. ✅Use Webpack CLI to crate webpack.config.js file and modify webpack.config.js based on our need.
use std::str::FromStr;
struct ParseError<'a, E> {
error: E,
source: &'a str,
}
fn parse<'a, T: FromStr>(s: &'a str) -> Result<T, ParseError<'a, T::Err>> {
s.parse().map_err(|e| ParseError { error: e, source: s })
}
@kuznero
kuznero / copy.go
Created January 28, 2018 20:05 — forked from r0l1/copy.go
Copy a directory tree (preserving permissions) in Go.
/* MIT License
*
* Copyright (c) 2017 Roland Singer [roland.singer@desertbit.com]
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
1 11684 base
2 4409 bytestring
3 3980 containers
4 3379 text
5 3099 mtl
6 2565 transformers
7 2019 directory
8 1791 filepath
9 1717 QuickCheck
10 1702 time
@kuznero
kuznero / free_monad_interpreter_pattern.md
Created May 5, 2017 08:45 — forked from CMCDragonkai/free_monad_interpreter_pattern.md
Haskell: Free Monad + Interpreter Pattern

Free Monad + Interpreter Pattern

It's like creating the front end and back end of a compiler inside Haskell without the need of Template Haskell!

Write your DSL AST as a Free Monad, and then interpret the monad any way you like.

The advantage is that you get to swap out your interpreter, and your main code

namespace WebSocket
// Appache 2.0 license
// References:
// [1] Proposed WebSockets Spec December 2011 http://tools.ietf.org/html/rfc6455
// [2] John McCutchan (Google Dart Team Member) http://www.altdevblogaday.com/2012/01/23/writing-your-own-websocket-server/
// [3] A pretty good Python implemenation by mrrrgn https://github.com/mrrrgn/websocket-data-frame-encoder-decoder/blob/master/frame.py
// [4] WebSockets Organising body http://www.websocket.org/echo.html
// [5] AndrewNewcomb's Gist (starting point) https://gist.github.com/AndrewNewcomb/711664
@kuznero
kuznero / Dockerfile
Created September 23, 2016 06:49 — forked from neoeinstein/Dockerfile
Freya on .NET Core Proof of Concept
FROM debian:jessie
EXPOSE 8080
RUN apt-get update && \
apt-get install -y libunwind8 libicu52 && \
rm -rf /var/lib/apt/lists/*
ADD bin/Release/netcoreapp1.3/debian.8-x64/publish/* /usr/local/lib/freya-svc/
ENTRYPOINT /usr/local/lib/freya-svc/freya-poc