Skip to content

Instantly share code, notes, and snippets.

View sreekanthsnair's full-sized avatar
:octocat:

Sreekanth S Nair sreekanthsnair

:octocat:
View GitHub Profile
@sreekanthsnair
sreekanthsnair / useful_git_commands.md
Last active October 16, 2018 10:19
Most useful git commands

Revert and push changes to a specific commit

git push -f origin <checksum>:<branch_name>

Resetting a branch to exactly match the remote branch

git fetch origin
git reset --hard origin/<branch_name>

Delete a tag from local & remote

@sreekanthsnair
sreekanthsnair / useful_postgresql_commands.md
Last active February 14, 2024 15:15
Most useful PostgreSQL queries for analytics

Tested in Postgres version 9.4

Check postgres connection usage

select max_conn,used,res_for_super,max_conn-used-res_for_super res_for_normal 
from 
  (select count(*) used from pg_stat_activity) t1,
  (select setting::int res_for_super from pg_settings where name=$$superuser_reserved_connections$$) t2,
  (select setting::int max_conn from pg_settings where name=$$max_connections$$) t3;
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../core-field/core-field.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-icons/core-icons.html">
<polymer-element name="my-element">
<template>
<style>
:host {