- Make a fork of the project to review, and from then on use that fork for the reviews
- Create an empty branch with 'git checkout --orphan', for example git checkout --orphan review-1-target
- Run git status and note that all files are staged. Remove all files by unstaging them first with git reset . and, after, cleanning them with git clean -df.
- On the empty branch, create an empty commit with git commit --allow-empty -m 'Empty commit'
- Push the empty branch to our fork, git push -u origin review-1-target
- Now let’s go to the branch we want to review (say master), and create a new branch from it: git checkout -b review-1.
- We then want to rebase from our empty/target branch. Make sure to place the empty commit as the first commit on the branch, git rebase -i review-1-target
- Push the branch to the fork, git push -u origin review-1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import pathlib | |
import torch | |
from transformers import AutoModel, AutoTokenizer | |
import json | |
from watchdog.observers import Observer | |
from watchdog.events import FileSystemEventHandler | |
# Settings | |
codebase_dir = "project/path" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::io::{self, BufRead}; | |
use std::process::exit; | |
const PLAYER_SYMBOL: [&str; 2] = ["X", "O"]; | |
fn main() { | |
let mut board: [[&str; 3]; 3] = [[" ", " ", " "], [" ", " ", " "], [" ", " ", " "]]; | |
let mut current_player: usize = 0; | |
let mut moves_count: u8 = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::io::{self, BufRead}; | |
use std::process::exit; | |
const PLAYER_SYMBOL: [&str; 2] = ["X", "O"]; | |
// TODO use enum instead of string representation | |
// TODO maybe use Display for printing proper values | |
fn main() { | |
let mut board: [[&str; 3]; 3] = [[" ", " ", " "], [" ", " ", " "], [" ", " ", " "]]; | |
let mut current_player: usize = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import requests | |
import aiohttp | |
import threading | |
lat = 52.52 | |
long = 13.41 | |
# async/await |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(base) ➜ gitgit git:(master) ✗ git commit -m "siema" | |
On branch master | |
Initial commit | |
Untracked files: | |
(use "git add <file>..." to include in what will be committed) | |
plik.txt | |
nothing added to commit but untracked files present (use "git add" to track) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<head> | |
<meta charset="UTF-8"> | |
</head> | |
<body> | |
<h1>Generowanie offline PIN Enko</h1> | |
<h2>Wprowadź numer wozaka</h2> | |
<input type="text" placeholder="Numer ID wozaka " id="pin_input"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib.admin import FieldListFilter | |
from django.utils.translation import ugettext as _ | |
class ActiveValueFilter(FieldListFilter): | |
"""list_filter which displays only the values for a field which are in use | |
This is handy when a large range has been filtered in some way which means | |
most of the potential values aren't currently in use. This requires a | |
queryset field or annotation named "item_count" to be present so it can |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//get VALUE/TEXT of select from html, to insert in format ('val','text'), | |
$('#SELECT_ID').children().each(function(index){console.log("('"+$(this).val() + "', '" + $(this).text()+ "'),");}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from django.core.mail import send_mail, mail_managers, EmailMultiAlternatives | |
from django.template.loader import render_to_string | |
from django.conf import settings | |
class Mailing: | |
path_prefix = 'mail/' | |
path_suffix = '.html' | |
prefix_title = u"TITLE BEGINNING - " |