This repository has been archived by the owner on May 7, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e86b83
commit 601344b
Showing
5 changed files
with
480 additions
and
434 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,44 @@ | ||
#!/bin/bash | ||
setup_git() { | ||
git config --global user.email "mst10041967@gmail.com" | ||
git config --global user.name "Rohit Tanwar" | ||
} | ||
|
||
commit_website_files() { | ||
if [ $TRAVIS_EVENT_TYPE != "pull_request" ]; then | ||
if [ $TRAVIS_BRANCH == "master" ]; then | ||
git checkout master | ||
echo "Committing to master branch..." | ||
git add -A | ||
echo "All files added" | ||
git status | ||
if [ $TRAVIS_EVENT_TYPE == "cron" ]; then | ||
git commit --message "Travis build: $TRAVIS_BUILD_NUMBER [cron]" | ||
elif [ $TRAVIS_EVENT_TYPE == "api" ]; then | ||
git commit --message "Travis build: $TRAVIS_BUILD_NUMBER [custom]" | ||
else | ||
git commit --message "Travis build: $TRAVIS_BUILD_NUMBER" | ||
fi | ||
echo "Files commited" | ||
git status | ||
fi | ||
fi | ||
} | ||
|
||
upload_files() { | ||
if [ $TRAVIS_EVENT_TYPE != "pull_request" ]; then | ||
if [ $TRAVIS_BRANCH == "master" ]; then | ||
echo "Pushing to master branch..." | ||
git push --force "https://${GH_TOKEN}@github.com/kriadmin/30-seconds-of-python-code.git" master > /dev/null 2>&1 | ||
echo "Pushing done" | ||
echo "Pushing to website" | ||
git subtree push --prefix website "https://${GH_TOKEN}@github.com/kriadmin/30-seconds-of-python-code.git" website | ||
echo "Pushed to master branch" | ||
git status | ||
fi | ||
fi | ||
} | ||
|
||
setup_git | ||
commit_website_files | ||
upload_files | ||
#!/bin/bash | ||
setup_git() { | ||
git config --global user.email "mst10041967@gmail.com" | ||
git config --global user.name "Rohit Tanwar" | ||
} | ||
|
||
commit_website_files() { | ||
if [ $TRAVIS_EVENT_TYPE != "pull_request" ]; then | ||
if [ $TRAVIS_BRANCH == "master" ]; then | ||
git checkout master | ||
echo "Committing to master branch..." | ||
git add -A | ||
echo "All files added" | ||
git status | ||
if [ $TRAVIS_EVENT_TYPE == "cron" ]; then | ||
git commit --message "Travis build: $TRAVIS_BUILD_NUMBER [cron]" | ||
elif [ $TRAVIS_EVENT_TYPE == "api" ]; then | ||
git commit --message "Travis build: $TRAVIS_BUILD_NUMBER [custom]" | ||
else | ||
git commit --message "Travis build: $TRAVIS_BUILD_NUMBER" | ||
fi | ||
echo "Files commited" | ||
git status | ||
fi | ||
fi | ||
} | ||
|
||
upload_files() { | ||
if [ $TRAVIS_EVENT_TYPE != "pull_request" ]; then | ||
if [ $TRAVIS_BRANCH == "master" ]; then | ||
echo "Pushing to master branch..." | ||
git push --force "https://${GH_TOKEN}@github.com/kriadmin/30-seconds-of-python-code.git" master > /dev/null 2>&1 | ||
echo "Pushing done" | ||
echo "Pushing to website" | ||
git subtree push --prefix website "https://${GH_TOKEN}@github.com/kriadmin/30-seconds-of-python-code.git" website | ||
echo "Pushed to master branch" | ||
git status | ||
fi | ||
fi | ||
} | ||
|
||
setup_git | ||
commit_website_files | ||
upload_files |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
def count_by(arr, fn=lambda x: x): | ||
key = {} | ||
for el in map(fn, arr): | ||
key[el] = 0 if not el in key else key[el] | ||
key[el] = 0 if el not in key else key[el] | ||
key[el] += 1 | ||
return 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
count_vowels | ||
byte_size | ||
capitalize | ||
capitalize_every_word | ||
decapitalize | ||
palindrome | ||
is_upper_case | ||
count_vowels | ||
byte_size | ||
capitalize | ||
capitalize_every_word | ||
decapitalize | ||
palindrome | ||
is_upper_case | ||
is_lower_case |
Oops, something went wrong.