Skip to content

Instantly share code, notes, and snippets.

View darwinbatres's full-sized avatar

Darwin Batres darwinbatres

View GitHub Profile

uploaded .DS_Store by mistake

git rm -r --cached **/.DS_Store
git commit -m "Remove .DS_Store files to enforce .gitignore rule"
git push

Firebase notes

Quotas and limits https://firebase.google.com/docs/functions/quotas

Manage functions https://firebase.google.com/docs/functions/manage-functions?gen=2nd

Quotas and limits https://firebase.google.com/docs/functions/quotas https://stackoverflow.com/questions/43313251/cloud-functions-for-firebase-killed-due-to-memory-limit-exceeded

generate random string from terminal

openssl rand -hex 32 Output example: 924b40a28783c7f3b3f22d18e893e1a499be53452e9326405104a5397b7799b6

CLI tools and others

Tig is an ncurses-based text-mode interface for git. It functions mainly as a Git repository browser, but can also assist in staging changes for commit at chunk level and act as a pager for output from various Git commands.

HTTPie is making APIs simple and intuitive for those building the tools of our time.

jq is like sed for JSON data - you can use it to slice and filter and map and transform structured data with the same ease that sed, awk, grep and friends let you play with text.

# launch pgadmin from docker
services:
pgadmin:
container_name: pgadmin
image: dpage/pgadmin4
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:-pgadmin4@pgadmin.org}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin}
PGADMIN_CONFIG_SERVER_MODE: 'False'
ports:

Create object from string separated by commas (javascript)

const str = "page1.page2.page3.page4.page5.page6";

const pages = str.split(".");

function createPages(pages) {
  if (pages.length > 2) {
 return {

Amplify notes

Using hosting with amplify (tested with Vue)

  • source address
</^[^.]+$|\.(?!(css|gif|ico|jpg|js|png|txt|svg|woff|ttf|map|json)$)([^.]+$)/>

Add messages with params

RuleName\t"+refParam+"
MustBeOlderThan\t"+Param.minAge+"

call activity from data transform

Get entries from agent queue table

-- default command to fetch all columns
/*
SELECT 
	*
FROM 
	pegadata.pr_sys_queues;
*/

PostgreSQL Describe Table

SELECT
	COLUMN_NAME
FROM
	information_schema.COLUMNS
WHERE
	TABLE_NAME = 'pc_pp_app001_work';