Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Ramon Moraes ramonmoraes8080

🏠
Working from home
View GitHub Profile
View tinder_browser_auto_like.js
function getElementByXpath(path) {
return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
}
function eventFire(el, etype){
if (el.fireEvent) {
el.fireEvent('on' + etype);
} else {
var evObj = document.createEvent('Events');
evObj.initEvent(etype, true, false);
@ramonmoraes8080
ramonmoraes8080 / android.sh
Last active Apr 6, 2020
Tests building Android 5.1.1_r38
View android.sh
android_version=5.1.1_r38
mkdir android-$android_version
cd android-$android_version/
git init .
git remote add origin https://android.googlesource.com/platform/system/core.git
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
@ramonmoraes8080
ramonmoraes8080 / 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):
@ramonmoraes8080
ramonmoraes8080 / 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
@ramonmoraes8080
ramonmoraes8080 / 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());
@ramonmoraes8080
ramonmoraes8080 / 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:

You can’t perform that action at this time.