Skip to content

Instantly share code, notes, and snippets.

View valerysntx's full-sized avatar
🔋
99%

valery sntx valerysntx

🔋
99%
  • Ukraine, Uzhgorod
View GitHub Profile
@valerysntx
valerysntx / hunter_setup_msvc.cmake
Created October 12, 2018 22:52
hunter_setup_msvc.cmake for using with Visual Studio 2017 (VS150COMNTOOLS fixes)
# Copyright (c) 2014-2016, Ruslan Baratov, Sumedh Ghaisas
# All rights reserved.
cmake_minimum_required(VERSION 3.0)
include(hunter_internal_error)
include(hunter_status_debug)
# Set next variables to the current scope:
# * HUNTER_MSVC_VERSION - version of Visual Studio. Used to create VS*COMNTOOLS
@valerysntx
valerysntx / Example1.cs
Created August 30, 2018 14:22 — forked from davidfowl/Example1.cs
How .NET Standard relates to .NET Platforms
namespace Analogy
{
/// <summary>
/// This example shows that a library that needs access to target .NET Standard 1.3
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library.
/// </summary>INetCoreApp10
class Example1
{
public void Net45Application(INetFramework45 platform)
@valerysntx
valerysntx / LimitedConcurrencyLevelTaskScheduler.cs
Created May 16, 2018 10:13
Limited Concurrency Level Task Scheduler
public class LimitedConcurrencyLevelTaskScheduler : TaskScheduler
{
[ThreadStatic]
private static bool _currentThreadIsProcessingItems;
private readonly LinkedList<Task> _tasks = new LinkedList<Task>();
private readonly int _maxDegreeOfParallelism;
private int _delegatesQueuedOrRunning = 0;
using System.Linq;
namespace System.Collections.Generic
{
public static class NestedCollectionsExtentions
{
public static IEnumerable<T> Traverse<T>(this T node, Func<T, IEnumerable<T>> childrenFor)
{
yield return node;
IEnumerable<T> enumerable = childrenFor(node);
@valerysntx
valerysntx / lamp.sh
Created March 16, 2018 05:47
'lame' lamp
wget http://software.virtualmin.com/gpl/scripts/install.sh
chmod +x ./install.sh
bash ./install.sh --minimal --bundle LAMP
@valerysntx
valerysntx / bash.reg
Created February 14, 2018 06:46
"bash here" shell extention
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\WSL]
@="Bash Prompt Here"
"Icon"="%USERPROFILE%\\AppData\\Local\\lxss\\bash.ico"
[HKEY_CLASSES_ROOT\Directory\Background\shell\WSL\command]
@="cmd.exe /c pushd \"%V\" && bash.exe"
@valerysntx
valerysntx / Language-Version-History.md
Created February 12, 2018 03:17
C# language-version-history

Features Added in C# Language Versions

C# 1.0 (Visual Studio.NET)

  • Classes
  • Structs
  • Interfaces
  • Events
  • Properties
@valerysntx
valerysntx / demo.html
Created February 11, 2018 19:43 — forked from RichAyotte/demo.html
Performance Comparison for React, Angular and Knockout
<!DOCTYPE html>
<html ng-app="test">
<head>
<title>Performance Comparison for Knockout, Angular and React</title>
<link href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/css/bootstrap.css" rel="stylesheet" />
<style type="text/css">
* { box-sizing:border-box; }
body { padding:30px 0; }
h2 { margin:0; margin-bottom:25px; }
h3 { margin:0; padding:0; margin-bottom:12px; }
@valerysntx
valerysntx / README.md
Created December 23, 2017 05:59 — forked from bsergean/README.md
offscreen rendering with three.js and headless-gl, in coffee-script

Getting the code

git clone https://gist.github.com/6780d7cc0cabb1b4d6c8.git

Executing the code

$ npm install # maybe npm start will take care of it but just in case
$ npm start && open out.png

> offscreen-sample@1.0.0 start /Users/bsergean/src/offscreen_sample

@valerysntx
valerysntx / pbr.glsl
Created December 5, 2017 14:05 — forked from galek/pbr.glsl
PBR GLSL SHADER
in vec2 v_texcoord; // texture coords
in vec3 v_normal; // normal
in vec3 v_binormal; // binormal (for TBN basis calc)
in vec3 v_pos; // pixel view space position
out vec4 color;
layout(std140) uniform Transforms
{
mat4x4 world_matrix; // object's world position