Skip to content

Instantly share code, notes, and snippets.

View agjs's full-sized avatar
⌨️

Aleksandar Grbic agjs

⌨️
View GitHub Profile
@agjs
agjs / something.json
Created February 20, 2024 20:54
alex-vscode-gist
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"eslint.format.enable": true,
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
@agjs
agjs / prettier.js
Created January 29, 2024 20:53
prettier
module.exports = {
arrowParens: "avoid",
bracketSpacing: true,
jsxSingleQuote: true,
printWidth: 80,
proseWrap: "always",
quoteProps: "as-needed",
semi: true,
singleQuote: false,
trailingComma: "none",
@agjs
agjs / settings.json
Created December 15, 2023 22:46
settings
{
"workbench.sideBar.location": "right",
"editor.fontFamily": "JetBrains Mono",
"editor.fontSize": 12,
"editor.fontLigatures": "'ss02' on, 'ss04' on, 'ss07' on, 'ss08' on, 'ss10' on, 'ss12' on",
"editor.lineHeight": 18,
"editor.fontVariations": true,
"background.backgroundOpacity": [0.85, 0.9, 0.9, 0.5],
"background.backgroundAlignment": [
"Center Center",
@agjs
agjs / tiptap.js
Created November 13, 2023 20:25
tiptap
export const tiptapToHtml = ({ string, idToLabel, enableSuggestions, controls }) => {
try {
if (!string) {
return "";
}
const htmlContent = sanitize(
generateHTML(JSON.parse(string), editorConfig({ controls, suggestionItems: () => [], idToLabel, enableSuggestions }).extensions),
{
allowedTags: ["p", "span", "a", "iframe", "img", ...getControls(controls)],
@agjs
agjs / gist.json
Created October 29, 2023 12:20
gist
{
"workbench.sideBar.location": "right",
"editor.fontFamily": "JetBrains Mono",
"editor.fontSize": 12,
"editor.fontLigatures": "'ss02' on, 'ss04' on, 'ss07' on, 'ss08' on, 'ss10' on, 'ss12' on",
"editor.lineHeight": 18,
"editor.fontVariations": true,
"background.backgroundOpacity": [0.95, 0.9, 0.9, 0.5],
"background.backgroundAlignment": [
"Center Center",
@agjs
agjs / test.json
Created July 27, 2023 20:45
VSCode Alex
{
"workbench.sideBar.location": "right",
"editor.fontFamily": "JetBrains Mono",
"editor.fontLigatures": true,
"background.backgroundOpacity": [
0.85,
0.9,
0.9,
0.5
],
@agjs
agjs / demo.js
Created May 22, 2023 20:15
axios twitch
// @ts-nocheck
import Axios from "axios";
import { setupCache } from "axios-cache-interceptor";
import { CUSTOM_ERRORS_ENUM } from "@Utils/constants";
import { BASE_API_URL } from "@Services/constants";
const axios = setupCache(Axios);
{
"editor.minimap.enabled": false,
"editor.wordWrap": "on",
"editor.fontSize": 14,
"editor.fontFamily": "Fira Code",
"editor.fontLigatures": "'ss01', 'ss02', 'ss03', 'ss04', 'ss05', 'ss06', 'zero', 'onum'",
"editor.renderWhitespace": "none",
"editor.bracketPairColorization.enabled": true,
"editor.guides.bracketPairs": true,
"workbench.sideBar.location": "right",
@agjs
agjs / em.js
Created February 22, 2023 20:55
event emitter
import { EventEmitter } from "events";
class NotificationSystem extends EventEmitter {
constructor() {
this.#init()
}
#init() {
this.on("follow", async (targetId, metadata) => {
const notification = await Models.notification.create({
@agjs
agjs / how-to-format-erb-vscode.json
Created March 26, 2021 10:53
Format .erb templates and ruby files inside VSCode
Details at: https://aleksandar.xyz/blog/formatting-ruby-and-erb-in-vscode/
"files.associations": {
"*.erb": "erb"
},
"[erb]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "aliariff.vscode-erb-beautify",
}