Skip to content

Instantly share code, notes, and snippets.

View abereghici's full-sized avatar
👨‍💻

Alexandru Bereghici abereghici

👨‍💻
View GitHub Profile
@abereghici
abereghici / shortcuts.md
Created December 17, 2024 14:13 — forked from memphys/shortcuts.md
Bash Shortcuts For Maximum Productivity

source: http://www.skorks.com/2009/09/bash-shortcuts-for-maximum-productivity/

Command Editing Shortcuts

  • Ctrl + a – go to the start of the command line
  • Ctrl + e – go to the end of the command line
  • Ctrl + k – delete from cursor to the end of the command line
  • Ctrl + u – delete from cursor to the start of the command line
  • Ctrl + w – delete from cursor to start of word (i.e. delete backwards one word)
  • Ctrl + y – paste word or text that was cut using one of the deletion shortcuts (such as the one above) after the cursor
@abereghici
abereghici / README.MD
Created December 15, 2024 09:03 — forked from Mosharush/README.MD
React Hook - Server-Sent Events (SSE)

Server-Sent Events (SSE) are commonly used in real-time applications where the server needs to push updates to the client.

Here are a few use cases:

  1. Real-time notifications: SSE can be used to push notifications to the client in real-time. For example, in a social media application, the server can push notifications about new posts, likes, comments, etc.
  2. Live news updates: In a news application, the server can push live news updates to the client.
  3. Real-time analytics: In an analytics dashboard, the server can push real-time data updates to the client.
  4. Chat applications: In a chat application, the server can push new messages to the client in real-time.
  5. Online multiplayer games: In an online multiplayer game, the server can push game state updates to the client in real-time.
  6. Stock price updates: In a stock trading application, the server can push real-time stock price updates to the client.
@abereghici
abereghici / bootable-win-on-mac.md
Created July 15, 2024 13:14 — forked from acarril/bootable-win-on-mac.md
Create a bootable Windows USB using macOS

For some reason, it is surprisingly hard to create a bootable Windows USB using macOS. These are my steps for doing so, which have worked for me in macOS Monterey (12.6.1) for Windows 10 and 11. After following these steps, you should have a bootable Windows USB drive.

1. Download a Windows disc image (i.e. ISO file)

You can download Windows 10 or Windows 11 directly from Microsoft.

2. Identify your USB drive

After plugging the drive to your machine, identify the name of the USB device using diskutil list, which should return an output like the one below. In my case, the correct disk name is disk2.

@abereghici
abereghici / settings.json
Created January 17, 2024 11:21 — forked from brotherkaif/settings.json
LazyVim keymappings for VSCode
{
"vim.showMarksInGutter": false,
"vim.foldfix": true,
"vim.surround": true,
"vim.easymotion": true,
"vim.easymotionKeys": "asdghklqwertyuiopzxcvbnmfj",
"vim.leader": "<space>",
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": [":", "w", "<CR>"],
@abereghici
abereghici / reset.css
Created June 20, 2022 14:43 — forked from EllyLoel/reset.css
CSS Reset
/*
Made by Elly Loel - https://ellyloel.com/
With inspiration from:
- Josh W Comeau - https://courses.joshwcomeau.com/css-for-js/treasure-trove/010-global-styles/
- Andy Bell - https://piccalil.li/blog/a-modern-css-reset/
- Adam Argyle - https://unpkg.com/[email protected]/normalize.min.css / https://codepen.io/argyleink/pen/KKvRORE
Notes:
- `:where()` is used to lower specificity for easy overriding.
*/
#!/bin/bash
# Author: Daniel Alvarenga Lima
# Ubuntu version supported: 18.04 LTS 64Bit
# EXECUTE
# sudo chmod +x script-configure-ubuntu18.94-amd64.sh
# ./script-configure-ubuntu18.94-amd64.sh
#INSTRUCTIONS
@abereghici
abereghici / bin.ts
Created June 16, 2021 10:33 — forked from wbern/bin.ts
rush-changed-projects (some process.env vars might be org-specific)
import { getCommand } from "./lib";
import { printCommand } from "./util";
import process from "process";
function main() {
const [
// eslint-disable-next-line @typescript-eslint/no-unused-vars
_,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
__,
@abereghici
abereghici / Jenkinsfile
Created April 29, 2021 21:39 — forked from wbern/Jenkinsfile
changed-rush-projects
# will become: rush build --to @org/project1 --to @org/project2 etc..
"\$(sh ./changed-rush-projects \"node common/scripts/install-run-rush.js --debug build\")"
@abereghici
abereghici / token-interceptor.service.ts
Last active December 29, 2023 17:54
Angular Tutorial — Implement Refresh Token with HttpInterceptor
// src/app/services/token-interceptor.service.ts
import { Injectable } from "@angular/core";
import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor } from "@angular/common/http";
import { AuthenticationService } from "../authentication.service";
import { Observable } from "rxjs/Observable";
import { BehaviorSubject } from "rxjs/BehaviorSubject";
@Injectable()
export class RefreshTokenInterceptor implements HttpInterceptor {