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 /
Created Jun 8, 2019
Python Iteration starting at X index without copying the list
fruits = ["apple", "orange", "banana"]
# Simple Method (Inefficient).
for fruit in fruits[1:]:
# Efficient Method (It doesn't needs to copy each element of the list).
from itertools import islice
arturoaviles /
Created Apr 17, 2019 — forked from Chaser324/
GitHub Standard Fork & Pull Request Workflow

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

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("Json:", json.dumps(request.get_data().decode('utf-8')))
print("Type:", type(json.dumps(request.get_data().decode('utf-8'))))
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
Replace: Anything You want $0
arturoaviles / gist:186dfe4f450de45c33c065c422c67af9
Created Dec 19, 2018
View gist:186dfe4f450de45c33c065c422c67af9
cat file.txt file2.txt > final_file.txt
arturoaviles /
Created Nov 29, 2018
Count Specific Word in File
grep -c "word" file

Pyenv Reminders

Update Pyenv

Check anyenv

Download a Python Version

pyenv install <version>
arturoaviles /
Last active Oct 18, 2018
Bombshell Bash Prank

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 /
Created Oct 6, 2018
Watson Conversation Entities Proximity in an Input String

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.


arturoaviles / steps.txt
Created Jul 12, 2018
Removing Secrets from Git Repos and History
View steps.txt
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.