Skip to content

Instantly share code, notes, and snippets.

View legraphista's full-sized avatar
😱
¯\_(ツ)_/¯

Ștefan-Gabriel Muscalu legraphista

😱
¯\_(ツ)_/¯
View GitHub Profile
In addition to a significant decrease in hepatic lipid accumulation in the IOE group, which inhibited energy intake by propionate enrichment, hepatic lipids were also significantly reduced in the mice in the IOP group, which was largely enriched with butyrate. Compared with the IOE group, IOP had a stronger regulatory effect on hepatic metabolism and triglyceride metabolism and higher levels of TCA cycle in the host. In addition, butyrate has the ability to promote browning of white adipose tissue (WAT) to brown adipose tissue (BAT).^[@ref39],[@ref40]^ WAT stores energy, whereas BAT uses energy for heating and consequently host energy expenditure increases.^[@ref41],[@ref42]^ However, adipose tissue weight does not change after WAT browning.^[@ref43]^ Therefore, the weight of adipose tissue of mice in the IOP group dominated by butyrate was greater than that of the mice in the IOE group dominated by propionate.
In conclusion ([Figure [7](#fig7){ref-type="fig"}](#fig7){ref-type="fig"}C), the improvement of ob
@legraphista
legraphista / example.ts
Last active July 4, 2024 12:37
MobX DataFrame for usage with React <Suspense/> api
class Configs extends DataFrame<Config[]> {
constructor() {
super({autoFetch: true});
}
protected async fetch(): Promise<Config[]> {
return fetch(`/config/list`)
}
}
@legraphista
legraphista / react-mobx-context-builder.ts
Last active October 15, 2023 20:06
React MobX Context Builder
import React, {useEffect, useRef, useState} from 'react'
type ProviderChildren<Store extends new (...args: any[]) => InstanceType<Store>> =
| { children: React.ReactNode }
| { children: React.ReactNode, staticStore: InstanceType<Store> }
| { children: React.ReactNode, arguments: ConstructorParameters<Store> }
type Lifecycle<S extends new (...args: any[]) => InstanceType<S>> = {
init?: (instance: InstanceType<S>) => void
@legraphista
legraphista / heystack.ts
Created April 2, 2023 13:00
Find a needle in a heystack in Typescript (walk object and find path of a structure)
export function find(hayStack: any, magnifier: (path: string[], key: string, value: any) => boolean) {
const foundPaths: { path: string[], key: string, value: unknown }[] = [];
function walk(obj: any, path: string[]) {
// console.log(path.join('.'), obj)
if (magnifier(path, path[path.length - 1], obj)) {
foundPaths.push({
path: path.slice(0, path.length - 1),
@legraphista
legraphista / test.js
Created October 12, 2021 17:40
simple beamcoder usage
const bc = require('beamcoder');
bc.demuxer('rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov').then(dm => console.log(dm.duration))
@legraphista
legraphista / test.js
Last active September 27, 2021 16:51
Electron 14 failing to open save dialog
const { app, BrowserWindow, dialog} = require('electron');
app.on('ready', async () => {
const mainWindow = new BrowserWindow({
center: true,
autoHideMenuBar: true,
webPreferences: {
nodeIntegration: true,
contextIsolation: false,
@legraphista
legraphista / Minecraft Dungeons Backuper.js
Last active June 3, 2020 14:38
Backup files when they change! (I'm looking at you, Minecraft Dungeons....)
// C:\Users\Stefan\AppData\Local\Packages\Microsoft.Lovika_8wekyb3d8bbwe\LocalCache\Local\Dungeons
const fs = require('fs');
const path = require('path');
const assert = require('assert');
const [toWatch, toBackup] = process.argv.slice(2);
assert(fs.existsSync(toWatch), `cannot find dir ${toWatch}`);
assert(fs.existsSync(toBackup), `cannot find backup dir ${toBackup}`);
@legraphista
legraphista / set-image.ps1
Last active May 2, 2022 19:47
powershell set folder ison from any image
[Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
[Reflection.Assembly]::LoadWithPartialName("System.Drawing.Bitmap")
[Reflection.Assembly]::LoadWithPartialName("System.Drawing.Graphics")
[Reflection.Assembly]::LoadWithPartialName("System.Drawing.Imaging")
[Reflection.Assembly]::LoadWithPartialName("System.Drawing.Icon")
[Reflection.Assembly]::LoadWithPartialName("System.IO")
function Img2Icon{
param ($image)
@legraphista
legraphista / binding.gyp
Created November 26, 2018 15:22
Minimal Napi Tensorflow C++ example
{
"targets": [
{
"target_name": "napi-testing",
'include_dirs': [
"<!@(node -p \"require('node-addon-api').include\")",
"src",
"/usr/local/include",
"/usr/local/tensorflow/include/"
],
@legraphista
legraphista / package.json
Last active November 18, 2018 11:58
v8 napi deconstruct failure
{
"name": "example",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {},
"author": "Stefan-Gabriel Muscalu <stefan.gabriel.muscalu@gmail.com> (http://my.corneroftheinternet.rocks/)",
"dependencies": {
"darknet-bindings": "git+ssh://git@github.com/legraphista/darknet-bindings.git#9d61036a1f8282ff870481a0079e31c1dc6f45d4",
"expose-gc": "^1.0.0"