Skip to content

Instantly share code, notes, and snippets.

View AbreuY's full-sized avatar
🎯
Focusing

AbreuY

🎯
Focusing
  • 127.0.0.1
View GitHub Profile
@AbreuY
AbreuY / postgres-cheatsheet.md
Last active May 20, 2023 00:42 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)

Análisis de técnicas para implementar cache en HOP

Resumen

Propuesta para cambiar los métodos para ingresar y leer el cache, para acelerar los tiempos de lectura y no tener que leer datos vencidos.

Motivación

@AbreuY
AbreuY / AndroidManifest required permissions.xml
Last active June 5, 2022 22:55 — forked from Sonderman/AndroidManifest required permissions.xml
Solution: How to access Android/data or Android/obb folders in Android 11+ No root
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/>
<uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES"/>
@AbreuY
AbreuY / template.js
Created March 10, 2022 23:12 — forked from claytongulick/template.js
if statement inside string template literals and lit-html.
//a quick example of how to use actual 'if' statements inside template literals,
//without using ternary operator. Sometimes this is cleaner if you have complex conditionals or nested conditionals.
//data param is passed in via render(template(data), this) - if not using lit-html, could be any function
template = (data) => html`
<div id="job_edit" class="modal">
<div class="modal-content">
${
//we're just going to wrap an anonymous inline function here and then call it with some data
(job => { //job here, is just an example, it could be anything, it's passed in below in (data.job)
if(job)
@AbreuY
AbreuY / force_external_url_for.py
Created February 1, 2022 01:08 — forked from johnsardine/force_external_url_for.py
Force Flask url_for to use domain name (absolute url)
# In manage.py add
# Make sure you import: from flask import url_for
@app.context_processor
def override_url_for():
return dict(url_for=external_url_for)
def external_url_for(endpoint, **values):
# Force absolute url in assets
if app.config.get('FORCE_EXTERNAL_URL'):
@AbreuY
AbreuY / randomNumber.js
Created January 12, 2022 22:07
Generate a random number from given numbers. min and max.
function randomNumber(min, max)
{
let result;
result = Math.floor(Math.random() * (max - min + 1)) + min;
return result;
}
@AbreuY
AbreuY / nvmCommands.js
Created December 15, 2021 09:08 — forked from chranderson/nvmCommands.js
Useful NVM commands
// check version
node -v || node --version
// list installed versions of node (via nvm)
nvm ls
// install specific version of node
nvm install 6.9.2
// set default version of node
@AbreuY
AbreuY / material_colors.xml
Created January 16, 2021 04:32 — forked from r0adkll/material_colors.xml
Material Design Colors
<!-- Colors specific to Material themes. -->
<resources>
<!-- RED -->
<color name="red_50">#fde0dc</color>
<color name="red_100">#f9bdbb</color>
<color name="red_200">#f69988</color>
<color name="red_300">#f36c60</color>
<color name="red_400">#e84e40</color>
@AbreuY
AbreuY / facebook-login.sh
Created November 13, 2020 02:35 — forked from rajapaju/facebook-login.sh
Login to Facebook using cURL
#!/bin/bash
# If it redirects to http://www.facebook.com/login.php at the end, wait a few minutes and try again
EMAIL='YOUR_EMAIL' # edit this
PASS='YOUR_PASSWORD' # edit this
COOKIES='cookies.txt'
USER_AGENT='Firefox/3.5'
@AbreuY
AbreuY / RealPathUtil.java
Created August 28, 2020 15:09 — forked from ImaginativeShohag/RealPathUtil.java
Real Path Utility class for Android. Tested till API 29. Kotlin version: https://gist.github.com/ImaginativeShohag/4e53572141c017369941bbbaac538576
import android.annotation.SuppressLint;
import android.content.ContentUris;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.os.Build;
import android.os.Environment;
import android.provider.DocumentsContract;
import android.provider.MediaStore;
import android.support.v4.content.CursorLoader;