Skip to content

Instantly share code, notes, and snippets.

View Kenan7's full-sized avatar

Mirkenan Kazımzade Kenan7

View GitHub Profile
@luismts
luismts / GitCommitBestPractices.md
Last active May 6, 2024 13:06
Git Tips and Git Commit Best Practices

Git Commit Best Practices

Basic Rules

Commit Related Changes

A commit should be a wrapper for related changes. For example, fixing two different bugs should produce two separate commits. Small commits make it easier for other developers to understand the changes and roll them back if something went wrong. With tools like the staging area and the ability to stage only parts of a file, Git makes it easy to create very granular commits.

Commit Often

Committing often keeps your commits small and, again, helps you commit only related changes. Moreover, it allows you to share your code more frequently with others. That way it‘s easier for everyone to integrate changes regularly and avoid having merge conflicts. Having large commits and sharing them infrequently, in contrast, makes it hard to solve conflicts.

@wsvincent
wsvincent / admin.py
Created November 2, 2018 19:23
Django Custom User Model for any new project
# users/admin.py
from django.contrib import admin
from django.contrib.auth import get_user_model
from django.contrib.auth.admin import UserAdmin
from .forms import CustomUserCreationForm, CustomUserChangeForm
from .models import CustomUser
class CustomUserAdmin(UserAdmin):
add_form = CustomUserCreationForm
@rsp
rsp / GitHub-Project-Guidelines.md
Last active November 15, 2023 03:50
Git Strict Flow and GitHub Project Guidelines - setup rules and git flow for commercial and open-source projects by @rsp

Git Strict Flow and GitHub Project Guidelines

Or how to turn this:

into this:

@19h47
19h47 / COMMAND.md
Last active January 23, 2018 03:10
Command

cd

The cd command is used to change the current directory.

cd stand for change directory

cd path/of/directory
@0xjac
0xjac / private_fork.md
Last active May 6, 2024 13:25
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@joelrojo
joelrojo / ajax_cheat_sheet.md
Last active February 6, 2024 08:35
AJAX 101 cheat sheet

#AJAX

What is AJAX

"AJAX an acronym for asynchronous JavaScript and XML is a group of interrelated web development techniques used on the client-side to create asynchronous web applications. With Ajax, web applications can send data to, and retrieve data from, a server asynchronously (in the background) without interfering with the display and behavior of the existing page. Data can be retrieved using the XMLHttpRequest object. Despite the name, the use of XML is not required (JSON is often used instead), and the requests do not need to be asynchronous." - wikipedia

AJAX with jQuery

jQuery provides a $.ajax() method with a set of options for sending requests and callback methods to handle responses.

  • Here is the most basic $.ajax() request that does not send any data. It will be handled by the post '/trips' route on the server. You can choose any of the http request verbs for the type parameter (get, post, put, delete)
@lornajane
lornajane / mac.md
Last active May 1, 2024 00:31
Keyboard Only OS X

Keyboard-only Mac Cheatsheet

Hi, I'm Lorna and I don't use a mouse. I have had RSI issues since a bad workstation setup at work in 2006. I've tried a number of extra hardware modifications but what works best for me is to use the keyboard and only the keyboard, so I'm in a good position and never reaching for anything else (except my coffee cup!). I rather unwisely took a job which required me to use a mac (I've been a linux user until now and also had the ability to choose my tools carefully) so here is my cheatsheet of the apps, tricks and keyboard shortcuts I'm using, mostly for my own reference. Since keyboard-only use is also great for productivity, you may also find some of these ideas useful, in which case at least something good has come of this :)

Apps List

There's more detail on a few of these apps but here is a quick overview of the tools I've installed and found helpful

Tool Link Comments
@ExpandOcean
ExpandOcean / kivy_cv.py
Created January 7, 2015 06:48
kivy and opencv work together demo
# coding:utf-8
from kivy.app import App
from kivy.uix.image import Image
from kivy.clock import Clock
from kivy.graphics.texture import Texture
import cv2
class KivyCamera(Image):
def __init__(self, capture, fps, **kwargs):
@staltz
staltz / introrx.md
Last active May 6, 2024 01:44
The introduction to Reactive Programming you've been missing
@zsup
zsup / ddd.md
Last active April 17, 2024 14:35
Documentation-Driven Development (DDD)

Documentation-Driven Development

The philosophy behind Documentation-Driven Development is a simple: from the perspective of a user, if a feature is not documented, then it doesn't exist, and if a feature is documented incorrectly, then it's broken.

  • Document the feature first. Figure out how you're going to describe the feature to users; if it's not documented, it doesn't exist. Documentation is the best way to define a feature in a user's eyes.
  • Whenever possible, documentation should be reviewed by users (community or Spark Elite) before any development begins.
  • Once documentation has been written, development should commence, and test-driven development is preferred.
  • Unit tests should be written that test the features as described by the documentation. If the functionality ever comes out of alignment with the documentation, tests should fail.
  • When a feature is being modified, it should be modified documentation-first.
  • When documentation is modified, so should be the tests.