Skip to content

Instantly share code, notes, and snippets.

View enheit's full-sized avatar
❤️
you

Roman Mahotskyi enheit

❤️
you
View GitHub Profile

Rust Error Handling Cheatsheet - Result handling functions

Introduction to Rust error handling

Rust error handling is nice but obligatory. Which makes it sometimes plenty of code.

Functions return values of type Result that is "enumeration". In Rust enumeration means complex value that has alternatives and that alternative is shown with a tag.

Result is defined as Ok or Err. The definition is generic, and both alternatives have

@loganpowell
loganpowell / graphql-args-passing.md
Last active June 8, 2023 17:51
GraphQL Passing Arguments (parent, args, context, info)
@emilioriosvz
emilioriosvz / mongoose-connection.js
Created April 4, 2018 09:40
connect with mongoose using async/await
const mongoose = require('mongoose')
mongoose.Promise = Promise
mongoose.connection.on('connected', () => {
console.log('Connection Established')
})
mongoose.connection.on('reconnected', () => {
console.log('Connection Reestablished')
@PCreations
PCreations / rxjs-diagrams.md
Last active January 18, 2024 08:52
Super Intuitive Interactive Diagrams to learn combining RxJS sequences by Max NgWizard K

Demo:

Spoiler warning

Spoiler text. Note that it's important to have a space after the summary tag. You should be able to write any markdown you want inside the <details> tag... just make sure you close <details> afterward.

console.log("I'm a code block!");
@bigsergey
bigsergey / review-checklist.md
Last active July 22, 2024 08:57
Front-end Code Review Checklist

Review checklist

General

  1. Does the code work?
  2. Description of the project status is included.
  3. Code is easily understand.
  4. Code is written following the coding standarts/guidelines (React in our case).
  5. Code is in sync with existing code patterns/technologies.
  6. DRY. Is the same code duplicated more than twice?
@datchley
datchley / react-redux-style-guide.md
Last active February 13, 2024 14:30
React + Redux Style Guide
@ummahusla
ummahusla / git-overwrite-branch.sh
Last active May 20, 2024 16:27 — forked from brev/git-overwrite-branch.sh
Git overwrite branch with another branch
# overwrite master with contents of feature branch (feature > master)
git checkout feature # source name
git merge -s ours master # target name
git checkout master # target name
git merge feature # source name
@Atlas7
Atlas7 / remove_postgres_on_mac_os.md
Last active March 23, 2023 13:02
Note - How completely uninstall PostgreSQL 9.X on Mac OSX

This blog post has helped me clean up my postgres development environment on Mac. So making a copy!

How completely uninstall PostgreSQL 9.X on Mac OSX

This article is referenced from stackoverflow:

If installed PostgreSQL with homebrew , enter brew uninstall postgresql

If you used the EnterpriseDB installer , follow the following step.
@nhtera
nhtera / OpenWithVisualStudioCode.bat
Created December 14, 2015 08:29
Open folders and files with Visual Studio Code from windows explorer context menu (tested in Windows 10)
@echo off
SET codePath=C:\Program Files (x86)\Microsoft VS Code\code.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Visual Studio Code" /t REG_SZ /v "" /d "Open with Visual Studio Code" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Visual Studio Code" /t REG_EXPAND_SZ /v "Icon" /d "%codePath%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Visual Studio Code\command" /t REG_SZ /v "" /d "%codePath% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Visual Studio Code" /t REG_SZ /v "" /d "Open with Visual Studio Code" /f