Skip to content

Instantly share code, notes, and snippets.

View sanikeev's full-sized avatar

Sergey Anikeyev sanikeev

View GitHub Profile
@sanikeev
sanikeev / postgres_queries_and_commands.sql
Created February 5, 2020 11:06 — forked from rgreenjr/postgres_queries_and_commands.sql
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%'
_log_pskb(date_created,link_id,logname,log)
account(id,uid,sum)
account_attach(account_id,file_id,name,orig_name)
account_transaction(user_id,yd)
activate_service(code,email,data)
admin_log_users(user_id,log_id,last_comment_view)
annoy(ip,last_req)
articles(title,short,msgtext,sign,logo,link)
articles_comments(from_id,parent_id,from_ip,created_time,article_id,msgtext,youtube_link)
articles_comments_files(comment_id,file_id,small,inline,temp)
@sanikeev
sanikeev / gist:8143057
Created December 27, 2013 05:48
Doctrine 2 + ZF2 example
<?php
// ... some code here
public function editAction() {
$auth = new AuthenticationService();
if (!$auth->hasIdentity()) {
$this->redirect()->toUrl('/login');
}
@sanikeev
sanikeev / gist:6952900
Last active December 25, 2015 09:19
permutation string golang
package main
import "fmt"
var arr []string
func main(){
// array
arr = make([]string,0)
force("asd", 3, "", func(thisString string){
/// array += thisString
@sanikeev
sanikeev / gist:6163843
Created August 6, 2013 11:53
PostgreSQL. Auto create partition tables trigger function.
-- Function: cb_stat_insert_trigger_function()
-- DROP FUNCTION cb_stat_insert_trigger_function();
CREATE OR REPLACE FUNCTION cb_stat_insert_trigger_function()
RETURNS trigger AS
$BODY$
DECLARE
dateName text;
<!doctype html>
<html>
<head><title>User Info</title></head>
<body>
<div id="#user" class="user">
<div class="name">
<label>User Name</label>
<input type="text" data-bind="value: name">
</div>