Skip to content

Instantly share code, notes, and snippets.

View ANDREYDEN's full-sized avatar
💭
Exploring the world

Andrii Denysenko ANDREYDEN

💭
Exploring the world
View GitHub Profile
Alias Command Description
glg git log --stat Verbose log of commits
glol git log --graph --pretty=format:'%h %s' Log with graph view
gcam git commit -a -m Commit all changes (not new files) with a message
gcmsg git commit -m Commit with a message
gcan! git commit --amend --no-edit Amend the last commit without editing the message
gca! git commit --amend Amend the last c
@ANDREYDEN
ANDREYDEN / solution.py
Created December 21, 2020 00:59
Advent of Code Day 20 Part 2
from itertools import product
from collections import defaultdict
import re
from pprint import pprint
from math import prod, sqrt
neighbours = [
[-1, 0],
[0, 1],
[1, 0],
@ANDREYDEN
ANDREYDEN / builds.md
Created June 2, 2020 14:35
[Unity builds] #unity

WEBGL

IOS

  • Player Settings > Other > Graphics API "Metal"
  • Player Settings > Other > target SDK "Device"
@ANDREYDEN
ANDREYDEN / setVsNew.md
Last active May 11, 2020 22:28
[Vector3.Set() vs new Vector3()] This problem occurs when you try to do `transform.position.Set()` #unity

Problem

private void OnEnable()
{
    transform.position = Vector3.zero;   
}

void Start()
{
 // this does not change the position of the object...
@ANDREYDEN
ANDREYDEN / iterm2.md
Last active May 9, 2020 22:32 — forked from squarism/iterm2.md
[ITerm Shortcuts] #hotkeys

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@ANDREYDEN
ANDREYDEN / booklist.md
Last active May 7, 2020 18:54
[Programming Books] A TOREAD list

Apprenticeship Patterns - D. Hoover

Clean Code - R. Martin

Working efficiently with legacy code

@ANDREYDEN
ANDREYDEN / vs.md
Last active May 8, 2020 13:23
[Visual Studio Shortcuts] #hotkeys
Hotkey Description
Opt + Arrows Move lines
Shift + F12 Find all references
Cmd + [ untab line
Cmd + ] tab line
@ANDREYDEN
ANDREYDEN / phpStorm.md
Last active May 11, 2020 19:41
[PHPStorm Shortcuts] #hotkeys
shortcut description
Ctrl + G select next occurance
Ctrl + Cmd + G select all occurances
Shift + F6 rename entity in code
Opt + F12 toggle terminal
Cmd + Shift + F12 toggle all sidebars
Opt + Cmd + M extract method
Opt + Cmd + V extract variable
Opt + Cmd + C extract constant
@ANDREYDEN
ANDREYDEN / Refactor.md
Last active May 11, 2020 21:01
[Refactoring techniques] #refactor

Refactoring techniques

  • write snapshot tests to have a way to verify refactoring
  • 2 mins for de-cluttering --> run tests --> commit
  • remove unused code and all the code that depends on it
  • extract all constans
  • extract pieces of code into descriptive methods

Theory

  • eliminate asymetric methods
@ANDREYDEN
ANDREYDEN / UsefullBits.cs
Last active May 6, 2020 22:47
[C# tricks] Usefull tricks to simplify code #unity
// dictionary shorthand declaration
Dictionary<int, string> students = new Dictionary<int, string>
{
[123456] = "Mary",
[314159] = "John",
[145145] = "Ethan"
};
// public readonly getter
private int _secret;