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
https://stackoverflow.com/questions/3042437/how-to-change-the-commit-author-for-one-specific-commit | |
git rebase -i <earliercommit> | |
for each commit you want to change: | |
change the text from "pick" to "edit" | |
git commit --amend --author="Author Name <[email protected]>" | |
git rebase --continue | |
git rebase --continue | |
done |
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
https://help.github.com/articles/checking-out-pull-requests-locally/ | |
checkout from origin | |
git fetch origin pull/ID/head:BRANCHNAME | |
git checkout BRANCHNAME | |
<do modifications> | |
<add> | |
<commit> | |
git push origin BRANCHNAME |
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
git fetch --all # or whatever to make sure your repo consistent with origin | |
git checkout -b new_branch_for_single_change upstream/master # or origin mater, dependes where's your base source | |
git cherry-pick hashcode_of_specific_commit | |
git push -u origin new_branch_for_single_change # push this new branch to origin | |
then create PR from new_branch_for_single_change branch on origin to upsteam |
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
ref stackoverflow: | |
https://stackoverflow.com/questions/41283955/github-keeps-saying-this-branch-is-x-commits-ahead-y-commits-behind | |
works by | |
1. git remote add upstream https://github/upstream/repo.git | |
2. git pull --rebase upstream master | |
2.1 git rebase --skip (if the conflicts are not true, skip the patches) | |
3. git push --force-with-lease origin master | |
If there are branches to fix |
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
## useful refs | |
* https://realpython.com/deploying-a-django-app-to-aws-elastic-beanstalk/#Create.the.Admin.User | |
* https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-django.html | |
## CLI approach | |
1. Enter your project root (versioned with Git) | |
2. install awsebcli | |
2.1 if encountering trouble installing PyYAML, using prepackages wheel: | |
3. > eb init |
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
This can be done in interactive python shell | |
> from django.core.management.utils import get_random_secret_key | |
> get_random_secret_key() |
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
- Django does not automatically check max_lenght limitation before save() | |
- Django does not automatically check choices before save() --> it's for form | |
for the length limitation, using | |
datamodel.full_clean() | |
datamodel.save() | |
can resolve it. or, override save() to enforce full_clean() | |
ex: |
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
ref: http://sushihangover.github.io/git-set-up-a-fetch-only-remote/ | |
> git remote -v # to see all remotes | |
> git remote set-url --push <remote_name> DISABLE | |
for example: | |
> git remote set-url --push upstream DISABLE | |
check again by | |
> git remote -v |
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
say you have ... | |
- upstream : https://github.com/xxxxx/project_a.git | |
- origin : https://github.com/yourself/fork_project_a.git | |
and there is a sibling project : https://github.com/community_contributor/fork_project_a.git | |
1. get into your git bash under fork_project_a | |
2. add sibling project as new remote: | |
git remote add community_contributor https://github.com/community_contributor/fork_project_a.git | |
3. git fetch (to update and also make sure new remote added) |
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 java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
import java.util.Scanner; | |
class Solution{ | |
public static void main(String[] args){ | |
Scanner in = new Scanner(System.in); | |
while(in.hasNext()){ | |
String IP = in.next(); |
NewerOlder