Skip to content

Instantly share code, notes, and snippets.

@adcv12587
adcv12587 / answer1.py
Created March 25, 2023 04:56
Oursky Developer PreTest 2023 - Lambert
# answer1.py
import re
def answer_1(dictionary: list):
max_words = 0
longest_str = ""
pattern = r'[a-z][A-Z]'
for string in Dictionary:
@rylev
rylev / learn.md
Created March 5, 2019 10:50
How to Learn Rust

Learning Rust

The following is a list of resources for learning Rust as well as tips and tricks for learning the language faster.

Warning

Rust is not C or C++ so the way your accustomed to do things in those languages might not work in Rust. The best way to learn Rust is to embrace its best practices and see where that takes you.

The generally recommended path is to start by reading the books, and doing small coding exercises until the rules around borrow checking become intuitive. Once this happens, then you can expand to more real world projects. If you find yourself struggling hard with the borrow checker, seek help. It very well could be that you're trying to solve your problem in a way that goes against how Rust wants you to work.

@nickytonline
nickytonline / settings.jsonc
Created May 5, 2024 18:25
Latest VS Code Settings
{
// miscellaneous
"javascript.updateImportsOnFileMove.enabled": "always",
"typescript.updateImportsOnFileMove.enabled": "always",
"diffEditor.ignoreTrimWhitespace": false,
// window
"window.title": "🦙⚡🫡 – ${activeEditorShort}${separator}${rootName} – 🫡⚡🦙",
"window.clickThroughInactive": false,
@qoomon
qoomon / conventional_commit_messages.md
Last active May 6, 2024 18:40
Conventional Commit Messages

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions and generate verion and changelogs

Commit Message Formats

Default

@tinsaeDev
tinsaeDev / example.js
Last active May 6, 2024 18:34
Ethiopian mobile phone number validation JavaScript regular expression ( Regexp )
function isEthiopianMobileNumber(telNumber){
return /^(0|251|\+251)(9|7)[0-9]{8}$/.test(telNumber)
}
@vasanthk
vasanthk / System Design.md
Last active May 6, 2024 18:32
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@devomman
devomman / office-activation.md
Created May 30, 2023 11:01
Office Activation Command by Omman

Office 2021

Method 1: Using my command line

Step 1.1: Open cmd program with administrator rights.

  • First, you need to open cmd in the admin mode, then run all commands below one by one.

Step 1.2: Get into the Office directory in cmd.

  • For x86 and x64
cd /d %ProgramFiles(x86)%\Microsoft Office\Office16
cd /d %ProgramFiles%\Microsoft Office\Office16
@wojteklu
wojteklu / clean_code.md
Last active May 6, 2024 18:30
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@julianbonilla
julianbonilla / GsonTest.java
Created May 24, 2012 21:18
Read json from file into Gson
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import com.google.gson.Gson;
public class GsonTest {
public static void main(String[] args) throws FileNotFoundException {
@dabrahams
dabrahams / EfficientMutableProjection.swift
Last active May 6, 2024 18:30
How to efficiently create a mutable projection without inducing CoW
/// Returns `(source, transform(source.pointee))` and destroys `source.pointee`.
///
/// This is a low-level utility for creating mutable projections of values without
/// causing needless copy-on-write.
///
/// Typical usage:
///
/// func f(x: inout X) { // inout means we have exclusive access to `x`.
/// var (xAddress, xFrobnication)
/// = unsafeMoveMap(destroying: &x) { x.frobnication() }