Skip to content

Instantly share code, notes, and snippets.

View deksoke's full-sized avatar

taywan deksoke

View GitHub Profile
@deksoke
deksoke / db_backup_commands.md
Created February 9, 2023 04:34 — forked from AtulKsol/db_backup_commands.md
Commands to backup & restore database
  1. pg_dump is a nifty utility designed to output a series of SQL statements that describes the schema and data of your database. You can control what goes into your backup by using additional flags.
    Backup: pg_dump -h localhost -p 5432 -U postgres -d mydb > backup.sql

    Restore: psql -h localhost -p 5432 -U postgres -d mydb < backup.sql

    -h is for host.
    -p is for port.
    -U is for username.
    -d is for database.

/*
1) Open https://popcat.click
2) Open console (F12)
3) Insert code & run
*/
var event = new KeyboardEvent('keydown', {
key: 'g',
ctrlKey: true
@deksoke
deksoke / .gitlab-ci.yml
Created July 15, 2020 10:18 — forked from zerda/.gitlab-ci.yml
Gitlab CI for ASP.Net Core project
stages:
- build
- publish
.build: &build_template
stage: build
image: microsoft/dotnet:2.1-sdk-alpine
cache:
key: "$CI_PROJECT_NAMESPACE-$CI_PROJECT_NAME"
paths:
@deksoke
deksoke / Global.cs
Created March 31, 2020 10:43
Create Schedule Job Task in .Net C# Web Application
public class Global : HttpApplication
{
void Application_Start(object sender, EventArgs e)
{
// Code that runs on application startup
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
TimeSpan intervalTimespan = TimeSpan.FromSeconds(30);
Task.Factory.StartNew(() => {
@deksoke
deksoke / Global.cs
Created March 31, 2020 10:40
Create Schedule Job Task in .Net C# Web Application
public class Global : HttpApplication
{
void Application_Start(object sender, EventArgs e)
{
// Code that runs on application startup
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
TimeSpan intervalTimespan = TimeSpan.FromSeconds(30);
Task.Factory.StartNew(() => {
@deksoke
deksoke / auto_assign_job.sql
Created March 13, 2020 06:36
Procedure Auto Assign Job To Employee Order by priority
--create or replace procedure cistp.PRC_ASSIGN_WORKJOB is
declare
vn_assign_lvl number := 0;
vc_empid varchar2(200) := '';
vn_roundno number := 0;
cursor c_job
is
select j.jobid
from jobs j
@deksoke
deksoke / GridView.aspx
Last active March 11, 2020 07:58
Bug Add NewRow ASPxGridView (DevExpress)
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WEB.ATS.Pages.Job.WebForm1" %>
<%@ Register Assembly="DevExpress.Web.v18.2, Version=18.2.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
@deksoke
deksoke / docker-compose.yml
Created November 27, 2019 14:50
grafana-monitoring
version: '3'
services:
prometheus:
image: prom/prometheus:latest
volumes:
- ./etc/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
command:
- '--config.file=/etc/prometheus/prometheus.yml'
ports:
- '9090:9090'
import { Injectable } from '@angular/core';
import { environment } from '../../../environments/environment';
import { Headers, Http, Response, URLSearchParams } from '@angular/http';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/toPromise';
import 'rxjs/add/operator/finally';
import 'rxjs/add/observable/throw';
import { throwError } from 'rxjs';