Skip to content

Instantly share code, notes, and snippets.

View gschema's full-sized avatar
😄
life is good

Dusan G gschema

😄
life is good
View GitHub Profile
@gschema
gschema / Changing author info (email and name) in Git repository.md
Last active November 17, 2019 04:39
Changing author info (email and name) in Git repository

Change author info for all commits (sledgehammer approach)

Copy/paste into a command line:

git filter-branch --commit-filter '
  GIT_COMMITTER_NAME="Your Name";
  GIT_AUTHOR_NAME="Your Name";
  GIT_COMMITTER_EMAIL="your.email@example.com";
 GIT_AUTHOR_EMAIL="your.email@example.com";
@gschema
gschema / emonoster-dual.zsh-theme
Last active November 14, 2019 11:54
2 line prompt with emojis - oh-my-zsh agnoster theme printing prompt in 2 lines with random emojis
# vim:ft=zsh ts=2 sw=2 sts=2
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts).
# Make sure you have a recent version: the code points that Powerline
@gschema
gschema / SelfControl App Notes.md
Last active October 5, 2022 08:05
How to adjust SelfControl app maximum block time and interval on the sliders

How to adjust SelfControl app maximum block time and interval on the sliders

Read this closely. If you do it wrong, SelfControl will not launch.

To adjust the maximum block time and interval on the sliders, just open Terminal.app in Applications --> Utilities, then enter the following two commands (substituting the words in brackets with numbers). Press enter after each line:

defaults write org.eyebeam.SelfControl MaxBlockLength -int [maximum block length in minutes]
defaults write org.eyebeam.SelfControl BlockLengthInterval -int [block length interval in minutes]
@gschema
gschema / Git - how to temporarily ignore and unignore file changes.md
Last active May 15, 2023 03:34
How to temporarily ignore and unignore file; check which files are ignored

How to temporarily ignore/unignore file changes in Git?

ignore:

git update-index --assume-unchanged <file>

unignore:

git update-index --no-assume-unchanged 
@gschema
gschema / Sublime Text.md
Last active August 29, 2015 14:15
Sublime Text notes and shortcuts

Sublime Text notes and shortcuts

The Command Palette

Access/search commands and apply with enter on selection of the command.

Shortcuts

cmd + shift + P - open then type ssx to narrow to set syntax options

@gschema
gschema / intro.md
Last active November 27, 2023 04:35
Basic JavaScript MVC Implementation

Basic JavaScript MVC Implementation

Despite being derived from classical MVC pattern JavaScript and the environment it runs in makes Javascript MVC implementation have its own twists. Lets see how typical web MVC functions and then dive into simple, concrete JavaScript MVC implementation.

How Web MVC typically works

Typical server-side MVC implementation has one MVC stack layered behind the singe point of entry. This single point of entry means that all HTTP requests, e.g. http://www.example.com or http://www.example.com/whichever-page/ etc., are routed, by a server configuration, through one point or, to be bold, one file, e.g. index.php.

At that point, there would be an implementation of Front Controller pattern which analyzes HTTP request (URI at first place) and based on it decides which class (Controller) and its method (Action) are to be invoked as a response to the request (method is name for function and member is name for a variable when part of the class/object).