Skip to content

Instantly share code, notes, and snippets.

View prosoftwaredev's full-sized avatar
🏘️
Working from home

prosoftwaredev

🏘️
Working from home
View GitHub Profile
@prosoftwaredev
prosoftwaredev / Drop Postgres Database
Last active May 9, 2018 19:44
How to drop a PostgreSQL database if there are active connections to it?
sudo -u postgres psql postgres
SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = 'DB NAME' AND pid <> pg_backend_pid();
import matplotlib
from matplotlib.ticker import FuncFormatter
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.gridspec as gridspec
import matplotlib.patches as mpatches
import matplotlib.lines as mlines
import matplotlib.pyplot as plt, mpld3
try:
from notebooks.styles import colors
import { DecimalPipe } from "@angular/common";
import { Pipe, PipeTransform } from "@angular/core";
@Pipe({name: "currency"})
export class CurrencyPipe implements PipeTransform {
private assetFormats = {
"USD": "1.2-2",
"BTC": "1.6-6"
};
import { Injectable } from "@angular/core";
import { Observable } from "rxjs/Observable";
import { environment } from "../../environments/environment";
import { Router } from "@angular/router";
import { HttpClient } from "@angular/common/http";
import { catchError } from "rxjs/operators";
import "rxjs/add/observable/throw";
import { AuthDataStorage } from "../../common/auth-data.storage";
export const TOKEN_STORAGE_KEY = "token";
import { Component, OnInit, ChangeDetectionStrategy, ChangeDetectorRef } from "@angular/core";
import { Subject } from "rxjs/Subject";
import { filter, takeUntil } from "rxjs/operators";
import { MatTableDataSource } from "@angular/material";
import { ElementsApiService } from "../../../common/services/elements-api.service";
import { OrderService } from "../../../common/services/orders.service";
import { OrderDto } from "../../shared/models/order-dto";
import { OrderStatus } from "../../../common/enums/order-status";
import { TransactionRouter } from "../../shared/transaction-router";
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 3000