Skip to content

Instantly share code, notes, and snippets.

View VanTigranyan's full-sized avatar

Van Tigranyan VanTigranyan

View GitHub Profile
@VanTigranyan
VanTigranyan / WSL 2 GNOME Desktop.md
Created December 12, 2021 20:56
Set up a GNOME desktop environment on WSL 2

WSL 2 GNOME Desktop

NOTE: If you want the ultimate Linux desktop experience, I highly recommend installing Linux as your main OS. I no longer use Windows (except in a VM) so I will not be maintaining this guide anymore.

Think Xfce looks dated? Want a conventional Ubuntu experience? This tutorial will guide you through installing Ubuntu's default desktop environment, GNOME.

GNOME is one of the more complex — and that means more difficult to run — desktop environments, so for years people couldn't figure [o

@VanTigranyan
VanTigranyan / stream_file.php
Created June 30, 2020 08:42 — forked from fideloper/stream_file.php
Stream file from S3 to browser, assume Laravel Filesystem usage
<?php
/*************************************************************************
* Get File Information
*/
// Assuming these come from some data source in your app
$s3FileKey = 's3/key/path/to/file.ext';
$fileName = 'file.ext';
@VanTigranyan
VanTigranyan / README.md
Created February 19, 2020 09:24 — forked from plugnburn/README.md
Landmark - a minimalistic and extensible Markdown compiler in JavaScript

Landmark: the simplest Markdown engine for the browser

Landmark is a small but extensible JavaScript library that allows to render Markdown documents into HTML. It's the primary engine for Sitemark and some other projects.

Usage

Landmark features only 2 methods:

@VanTigranyan
VanTigranyan / mongo.ts
Created May 29, 2019 14:12
mongo aggregation
export function fetchRequestedKernelsList(page: number, rfxType, requestStatus) {
const match = {
$or: [
{
rfxType: rfxType,
},
{
rfxType: 'both',
},
],
@VanTigranyan
VanTigranyan / nested_observables_in_loops.ts
Created May 29, 2019 11:29
nested observables in loops
public getKernelAttachments(kernelId: IDBId) {
this.waitingForFiles = kernelId;
this.service.getKernelAttachments(kernelId)
.pipe(
mergeMap((fileIds: IDBId[]) => {
const packsArray = fileIds.map((id) => {
return this.service.getKernelFilePack(id);
});
return forkJoin(...packsArray).pipe(
map((packs) => {
@VanTigranyan
VanTigranyan / main.js
Created May 10, 2019 11:25
Javascript-print pyramide with just one while loop.
function printPiramyde() {
let row = 1;
let col = 1;
let start = 5;
let end = 5;
while (row <= 5 && col <= 9) {
if ((col < start || col > end) && col !== 9) {
document.write('&nbsp;');
col += 1;
} else if (col === 9) {