Skip to content

Instantly share code, notes, and snippets.

View SKumarSpace's full-sized avatar
🌆
Working from the sky

Shrey Kumar SKumarSpace

🌆
Working from the sky
View GitHub Profile
@rchardptrsn
rchardptrsn / compose_sql_server.yaml
Last active February 13, 2025 06:25
Docker compose file for SQL Server 2022
services:
mssql:
container_name: mssql-db
hostname: mssql-db
image: mcr.microsoft.com/mssql/server:2022-latest
environment:
ACCEPT_EULA: 'Y'
MSSQL_SA_PASSWORD: 'Passw0rd'
MSSQL_DATA_DIR: /var/opt/mssql/data
@mizchi
mizchi / printTemplate.ts
Created February 9, 2021 08:20
Generate code from svelte ast
import prettier from "prettier/standalone";
import produce from "immer";
import { parse } from "svelte/compiler";
import type { Ast } from "svelte/types/compiler/interfaces";
// @ts-ignore
import * as sveltePlugin from "prettier-plugin-svelte";
function printTemplate(ast: Ast) {
const overridePlugin = produce(sveltePlugin, (d: any) => {
d.parsers.svelte.parse = () => {
@ahmetozer
ahmetozer / multiple-exec-at-go-example.go
Created April 20, 2020 16:23
Golang Multiple exec.Command at same time with pipelining
package main
import (
// "fmt"
"os/exec"
"os"
)
func main() {
topCommand := exec.Command("top","-d 0.5", "-b", "-n 5")
@DanielSmon
DanielSmon / New MS Teams Profile.cmd
Last active June 19, 2024 23:48
For running multiple MS Teams accounts side by side. Save this with the name of the MS Teams profile you wish to use. When launched, a folder will be created in your user profile. See https://danielsmon.com/2020/04/02/multiple-ms-teams-accounts-on-the-desktop/.
@ECHO OFF
REM Uses the file name as the profile name
SET MSTEAMS_PROFILE=%~n0
ECHO - Using profile "%MSTEAMS_PROFILE%"
SET "OLD_USERPROFILE=%USERPROFILE%"
SET "USERPROFILE=%LOCALAPPDATA%\Microsoft\Teams\CustomProfiles\%MSTEAMS_PROFILE%"
REM Ensure there is a downloads folder to avoid error described at
@mrpeardotnet
mrpeardotnet / PMG-Enable Avast Antivirus.md
Created January 30, 2020 09:50
Enable Avast AV (Avast Business Antivirus) security in Proxmox Mail Gateway (PMG)

Enable Avast AV (Avast Business Antivirus) security in Proxmox Mail Gateway (PMG) 6.x

This cheatsheet shows how to install and enable Avast antivirus (Avast Business Antivirus for Linux) on your PMG server.

Please note that Avast Business Antivirus for Linux is not provided for free and you need to buy license. You can test it for free after requesting trial license.

Prepare the apt package manager

Download and install avast.gpg key:

wget -q -O - https://files.avast.com/files/resellers/linux/avast.gpg | apt-key add -
library(V8)
library(mapview)
library(geojsonsf)
ct = v8(global="window")
ct$source("https://cdn.jsdelivr.net/npm/[email protected]/dist/flatgeobuf-geojson.min.js")
ct$get("Object.keys(window)")
fran = sf_geojson(franconia[1, ])
@agrazh
agrazh / GlbConstants.js
Last active April 7, 2023 18:38
[Pre-defined page, with filters on lookup fields, for Creatio CRM]
define("GlbConstants", [], function() {
var accountType = {
OurDepartment: "01d5bbff-8d27-49a5-a338-a3875dd536e3",
OurBranch: "a2f28c3e-0af9-4e66-8550-8b0436d8276a"
};
var account = {
HQ: "e308b781-3c5b-4ecb-89ef-5c1ed4da488e"
};
@stekhn
stekhn / writeConcurrent.js
Created August 6, 2018 15:47
Concurrently write one JSON file from multiple processes spawned by the Node.js "cluster" module. Uses a lockfile to prevent hickups.
const fs = require('fs');
const os = require('os');
const path = require('path');
const cluster = require('cluster');
const lockFile = require('lockfile');
const filePath = path.resolve(__dirname, 'result.json');
const lockPath = path.resolve(__dirname, 'result.json.lock');
@NaniteFactory
NaniteFactory / messagebox.go
Last active December 17, 2024 12:17
Win32 API MessageBox() in Golang
import (
"syscall"
"unsafe"
)
// MessageBox of Win32 API.
func MessageBox(hwnd uintptr, caption, title string, flags uint) int {
ret, _, _ := syscall.NewLazyDLL("user32.dll").NewProc("MessageBoxW").Call(
uintptr(hwnd),
uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(caption))),
@mkjiau
mkjiau / axios-interceptors-refresh-token.js
Last active February 17, 2025 14:25
Axios interceptors for token refreshing and more than 2 async requests available
let isRefreshing = false;
let refreshSubscribers = [];
const instance = axios.create({
baseURL: Config.API_URL,
});
instance.interceptors.response.use(response => {
return response;
}, error => {