Skip to content

Instantly share code, notes, and snippets.

View lfreneda's full-sized avatar
💙
Always deliver more than expected.

Luiz Freneda lfreneda

💙
Always deliver more than expected.
View GitHub Profile
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active April 23, 2024 19:14
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@ericelliott
ericelliott / essential-javascript-links.md
Last active April 22, 2024 10:15
Essential JavaScript Links

How to setup AWS lambda function to talk to the internet and VPC

I'm going to walk you through the steps for setting up a AWS Lambda to talk to the internet and a VPC. Let's dive in.

So it might be really unintuitive at first but lambda functions have three states.

  1. No VPC, where it can talk openly to the web, but can't talk to any of your AWS services.
  2. VPC, the default setting where the lambda function can talk to your AWS services but can't talk to the web.
  3. VPC with NAT, The best of both worlds, AWS services and web.
@coolaj86
coolaj86 / how-to-publish-to-npm.md
Last active April 2, 2024 20:18
How to publish packages to NPM

Getting Started with NPM (as a developer)

As easy as 1, 2, 3!

Updated:

  • Aug, 08, 2022 update config docs for npm 8+
  • Jul 27, 2021 add private scopes
  • Jul 22, 2021 add dist tags
  • Jun 20, 2021 update for --access=public
  • Sep 07, 2020 update docs for npm version
@aemonge
aemonge / prepare-commit-msg
Last active March 1, 2024 01:02
Angular Commit Message Conventions git hook, so you got your commit prepared to with the messages they expect ;)
#!/bin/bash
firstLine=`head -2 $1 | tail -1`
if [[ $firstLine == \#* ]]; then # Testing that the file starts with a comment, not yet a real commit ;)
echo '<type>(<component>): <subject>' > .prepare-commit-msg-temp
echo '' >> .prepare-commit-msg-temp
echo '<body>' >> .prepare-commit-msg-temp
echo '' >> .prepare-commit-msg-temp
echo '# types: feat, fix, docs, style, refactor, test, chore(mantean)' >> .prepare-commit-msg-temp
@mooniker
mooniker / roles_investigation.md
Last active February 29, 2024 21:55 — forked from facultymatt/roles_invesitgation.md
Roles and permissions system for Nodejs

ACL / Roles + Permissions

Virgen-ACL (virgen-acl)

  • https://github.com/djvirgen/virgen-acl
  • "Simple in-memory ACL for node.js apps. Supports arbitrary roles and resources, including role/resource detection using a simple interface. Additionally supports custom assertions for more complex rules."
  • Comments: "Simple and elegant, create your own checks. No middleware?"

Node ACL (acl) BuildStatusDependency StatusdevDependency Status

@julionc
julionc / 00.howto_install_phantomjs.md
Last active February 21, 2024 11:01
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
@wbroek
wbroek / genymotionwithplay.txt
Last active February 12, 2024 03:22
Genymotion with Google Play Services for ARM
NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
@raineorshine
raineorshine / _chrome-ext-auth-identity.md
Last active November 10, 2023 23:57
How to set up user authentication for a Chrome Extension using the Chrome Identity API

How to set up user authentication for a Chrome Extension using the Chrome Identity API

  1. Create a private key file, from which you can create the manifest key and Application ID, as detailed here: https://stackoverflow.com/questions/23873623/obtaining-chrome-extension-id-for-development
  2. Add the manifest key to "key" in manifest.json
  3. Create a new project in Google Developer Console https://console.developers.google.com/project
  4. Go to "APIs & auth > Credentials" and create new client id for a Chrome Application using the Application ID generated in step 3.
  5. Copy the Client ID to oauth2.client_id in the manifest.json

Deprecated?

@mplatts
mplatts / 0firebase_functions_cheatsheet.js
Last active October 31, 2023 22:15
Firebase functions cheatsheet
// Core
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp(functions.config().firebase);
const db = admin.database();
admin.auth().createUser({
uid: uid,
displayName: displayName,
photoURL: photoURL