Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Ramon Moraes vyscond

🏠
Working from home
Block or report user

Report or block vyscond

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
View aws-cli-cheatsheet.sh
# Elastic Beanstalk
## Delete specific application version
aws elasticbeanstalk delete-application-version \
--version-label $eb_application_version \
--application-name $eb_application_name \
--profile $profile
# ECS
## Discover when the service was created
@vyscond
vyscond / settings.py
Created Jul 12, 2018
Avoid migrations while running unit test on all Django versions
View settings.py
# Avoid migrations while running unit test on all Django versions
TESTING = sys.argv[1:2] == ['test']
if TESTING:
import django
if django.VERSION[1] < 9:
class DisableMigrations(object):
def __contains__(self, item):
return True
def __getitem__(self, item):
@vyscond
vyscond / supervisor-out.conf
Created Jul 2, 2018
Supervisor config to show meaningful outputs
View supervisor-out.conf
[supervisord]
nodaemon=true
[program:django]
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
directory = /usr/src/app/
command = python manage.py runserver 0.0.0.0:8000
@vyscond
vyscond / RecycleViewOnScrollListener.java
Created Dec 30, 2017
Just a sample of how to load more when reaching top or bottom
View RecycleViewOnScrollListener.java
public class RecycleViewPlus extends RecycleView {
OnScrollListener onScrollListener = new OnScrollListener() {
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
LayoutManager layoutManager = RecycleViewPlus.this.getLayoutManager();
View view = recyclerView.getChildAt(layoutManager.getChildCount() - 1);
Log.d(AppHelper.LogTags.API, "dy <" + dy + ">");
Log.d(AppHelper.LogTags.API, "recyclerView.getHeight: " + recyclerView.getHeight());
@vyscond
vyscond / aws_python_error_schema.json
Created Nov 24, 2017
Basic JSON schema (draft 4) to Python Exception/Error.
View aws_python_error_schema.json
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Error Schema for Python",
"type": "object",
"properties": {
"errorMessage": { "type" : "string" },
"errorType": { "type" : "string" },
"stackTrace": {
"type": "array",
"items": {
View moonspacetv.css
@-moz-document domain("moonspacetv.com") {
div#chat {
display: none;
}
div#player {
width: 100% !important;
}
div#header {
View install-kubeadmin.sh
yum install -y docker && \
systemctl start docker && \
systemctl enable docker && \
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && \
chmod +x ./kubectl && \
mv ./kubectl /usr/local/bin/kubectl
cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
View keybase.md

Keybase proof

I hereby claim:

  • I am vyscond on github.
  • I am ramonmoraes (https://keybase.io/ramonmoraes) on keybase.
  • I have a public key whose fingerprint is DF11 ABE0 0F10 81E3 446E C542 CFDC B42C 442A BB44

To claim this, I am signing this object:

View gist:23ab7a6af31f1e1b2fe1c7b6b259bb5f
### Keybase proof
I hereby claim:
* I am vyscond on github.
* I am vyscond (https://keybase.io/vyscond) on keybase.
* I have a public key whose fingerprint is 3D49 0F67 21A6 7D05 BFCB 4220 5FFD F34A 2167 D210
To claim this, I am signing this object:
@vyscond
vyscond / fizzbuzz.py
Created Apr 3, 2016
The Fizz Buzz test in python
View fizzbuzz.py
def run(start, end, three, five, both):
end += 1
for n in range(start, end):
if n % 15 == 0:
print(both)
elif n % 3 == 0:
print(three)
elif n % 5 == 0:
print(five)
else:
You can’t perform that action at this time.