Skip to content

Instantly share code, notes, and snippets.

@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() }
# .gitignore for Unreal Engine projects with embedded Wwise projects
# This is a work in progress, please report any issues to Quin Henshaw
# Unreal
Binaries/
DerivedDataCache/
Intermediate/
Plugins/*/Intermediate/
Saved/
Build/
@gabe565
gabe565 / change-arc-icon.md
Last active May 6, 2024 18:25
Change Arc Browser Icon

Change Arc Browser Icon

arc

A collection of commands that change the Arc Browser icon.

Commands

Theme Command
Candy Arc defaults write company.thebrowser.Browser currentAppIconName candy
@Jekins
Jekins / Markdown-docs.md
Last active May 6, 2024 18:23
Руководство по оформлению Markdown файлов

Руководство по оформлению Markdown файлов

Markdown - это облегчённый язык разметки, который преобразует текст в структурированный HTML. Следующее руководство поможет вам разобраться, как использовать Markdown.

Заголовки

# Заголовок первого уровня
## Заголовок второго уровня
### Заголовок третьего уровня
#### Заголовок четвёртого уровня
##### Заголовок пятого уровня
@jeetsukumaran
jeetsukumaran / build-gcc.sh
Last active May 6, 2024 18:18
Build and Install GCC Suite from Scratch
#! /bin/bash
GCC_VERSION="5.2.0"
WORKDIR="$HOME/src/"
INSTALLDIR="/platform"
## NOTE: XCode must be installed (through App Store) and the following run to install command-line tools.
## THIS IS IMPORTANT! Among other things, it creates '/usr/include' and installs the system header files.
# xcode-select --install
@jesster2k10
jesster2k10 / README.md
Last active May 6, 2024 18:16
Rails API Social Login

Rails API-Only Social Login

This is another piece of code I've extrapolated from a Ruby on Rails project I'm currently working on. The code implmenets social login with a RoR API-based application, targeted at API clients.

The setup does not involve any browser-redirects or sessions as you would have to use working with Omniauth. Instead, what it does is takes an access_token generated on client-side SDKs, retireves user info from the access token and creates a new user and Identity in the database.

This setup works with native applications as described in the Google iOS Sign In Docs (see Authenticating with a backend server)