Skip to content

Instantly share code, notes, and snippets.

View maxkhrichtchatyi's full-sized avatar
🚀
Progress can't be stopped

Max Khrichtchatyi maxkhrichtchatyi

🚀
Progress can't be stopped
View GitHub Profile
### Keybase proof
I hereby claim:
* I am j0shu4b0y on github.
* I am j0shu4b0y (https://keybase.io/j0shu4b0y) on keybase.
* I have a public key ASAIfLueuYpT_u2FXhkSsL1cHc9HLb89ECkAHx_4r46DKQo
To claim this, I am signing this object:
@maxkhrichtchatyi
maxkhrichtchatyi / main.c
Created February 21, 2020 05:22
C Lang access to a variable
#include "point.h"
#include <stdio.h>
int main() {
struct Point* p1 = createPoint(7);
int point = getPoint(p1);
// Everything is OK!
printf("%d", point);
@maxkhrichtchatyi
maxkhrichtchatyi / add_on_delete_to_models.py
Created May 4, 2019 12:37
Add on_delete=models.CASCADE to Django models automatically (Django 2.0 migration)
from os import listdir, walk
from os.path import isfile, join
list_of_files = []
def is_model_file(file_name):
return bool('models.py' == file_name)
for root, directories, files in walk('.'):
for file_item in files:
@maxkhrichtchatyi
maxkhrichtchatyi / nginx-tuning.md
Created September 7, 2017 20:51 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@maxkhrichtchatyi
maxkhrichtchatyi / The Technical Interview Cheat Sheet.md
Created September 7, 2017 20:47 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@maxkhrichtchatyi
maxkhrichtchatyi / php-interview.md
Created September 7, 2017 20:45 — forked from messified/php-interview.md
PHP Engineer Interview: What you should know

PHP Developer Interview: What you should know

###1. What’s the difference between " self " and " this " ?

Use $this to refer to the current object. Use self to refer to the current class. In other words, use $this->member for non-static members, use self::$member for static members.

Source: When to use self vs this -stackoverflow

@maxkhrichtchatyi
maxkhrichtchatyi / attack.md
Created July 8, 2017 22:05 — forked from timruffles/attack.md
Chrome/Gmail attack received 11/03/2016. Not sure if the Chrome meta refresh + data:text,html technique is novel.

The following attack will display a "you've been signed out" page for GMail, and attempt to steal your account credentials.

DO NOT PUT ANY ACCOUNT CREDENTIALS INTO ANY TABS CREATED AFTER VISITING THESE LINKS :)

I received an email in my GMail inbox with a fake attachment image, styled to look like the real GMail attachment UI:

fake

This linked to a page that ended up displaying a fake "you've been signed out" link, via the data:text/html... URL feature of Chrome: