Skip to content

Instantly share code, notes, and snippets.

Arturo Avilés arturoaviles

Block or report user

Report or block arturoaviles

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@arturoaviles
arturoaviles / iteration_without_copy.py
Created Jun 8, 2019
Python Iteration starting at X index without copying the list
View iteration_without_copy.py
fruits = ["apple", "orange", "banana"]
# Simple Method (Inefficient).
for fruit in fruits[1:]:
print(fruit)
# Efficient Method (It doesn't needs to copy each element of the list).
from itertools import islice
@arturoaviles
arturoaviles / GitHub-Forking.md
Created Apr 17, 2019 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow
View GitHub-Forking.md

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

View check_flask_request.py
print("Request Content Type:", request.content_type)
print("Is it Json?", request.is_json)
print("Request Data Type:",type(request.get_data()))
print("Request Data", request.get_data())
print(request.args)
print(request.get_data().decode('utf-8'))
print(type(request.get_data().decode('utf-8')))
print("Json:", json.dumps(request.get_data().decode('utf-8')))
print("Type:", type(json.dumps(request.get_data().decode('utf-8'))))
@arturoaviles
arturoaviles / instructions.txt
Created Feb 21, 2019
Add string before or after every line in VS Code file using regex expression
View instructions.txt
Find: ^(.*)$
Replace: $0 Anything You want
or
Replace: Anything You want $0
@arturoaviles
arturoaviles / gist:186dfe4f450de45c33c065c422c67af9
Created Dec 19, 2018
combine_files_in_user_order_into_another_file.sh
View gist:186dfe4f450de45c33c065c422c67af9
cat file.txt file2.txt > final_file.txt
@arturoaviles
arturoaviles / count_word_in_file.sh
Created Nov 29, 2018
Count Specific Word in File
View count_word_in_file.sh
grep -c "word" file
View README.md

Pyenv Reminders

Update Pyenv

Check anyenv

Download a Python Version

pyenv install <version>
@arturoaviles
arturoaviles / INSTRUCTIONS.md
Last active Oct 18, 2018
Bombshell Bash Prank
View INSTRUCTIONS.md

Bombshell Bash Prank

The next 2 commands can give a real headache to another person, use them with responsability!

1st Command: Bash/Terminal Bombshell (Not so evil one):

This command will be executed when your friend opens a new bash window.

Copy and run the next command in you friends computer:

@arturoaviles
arturoaviles / watson_conversation_entities_proximity_in_a_string.md
Created Oct 6, 2018
Watson Conversation Entities Proximity in an Input String
View watson_conversation_entities_proximity_in_a_string.md

Watson Conversation Entities Proximity in an Input String

This method can be used when you want to detect if 2 entities are next to each other

Example #1 Negative Number

In this example you get -1 if the entities are next to each other, you can change the order of the operation like in the example 2 to get the positive number 1.

Formula

@arturoaviles
arturoaviles / steps.txt
Created Jul 12, 2018
Removing Secrets from Git Repos and History
View steps.txt
https://help.github.com/articles/removing-sensitive-data-from-a-repository/
Removing sensitive data from a repository
If you commit sensitive data, such as a password or SSH key into a Git repository, you can remove it from the history. To entirely remove unwanted files from a repository's history you can use either the git filter-branch command or the BFG Repo-Cleaner.
The git filter-branch command and the BFG Repo-Cleaner rewrite your repository's history, which changes the SHAs for existing commits that you alter and any dependent commits. Changed commit SHAs may affect open pull requests in your repository. We recommend merging or closing all open pull requests before removing files from your repository.
You can remove the file from the latest commit with git rm. For information on removing a file that was added with the latest commit, see "Removing files from a repository's history."
You can’t perform that action at this time.