Skip to content

Instantly share code, notes, and snippets.

View ramzes13's full-sized avatar

petru ramzes13

  • chisinau
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%'
@jehaby
jehaby / README.md
Last active January 25, 2024 14:43 — forked from chadrien/README.md
Debug PHP in Docker with PHPStorm and Xdebug

Debug your PHP in Docker with Intellij/PHPStorm and Xdebug

  1. For your local dev, create a Dockerfile that is based on your production image and simply install xdebug into it. Exemple:
FROM php:5

RUN yes | pecl install xdebug \
    && echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
@mitchwongho
mitchwongho / Docker
Last active November 29, 2023 06:36
Docker 'run' command to start an interactive BaSH session
# Assuming an Ubuntu Docker image
$ docker run -it <image> /bin/bash
@jexp
jexp / fetch_tree.adoc
Created June 19, 2015 22:09
Fetch a Tree with Neo4j

Fetch a Tree with Neo4j

Today I came across a really interesting StackOverflow question:

Given a forest of trees in a Neo4j REST server, I`m trying to return a single tree given the root vertex. Being each tree quite large, I need a de-duplicated list of all vertices and edges in order to be able to reconstruct the full tree on the client side.

@reu
reu / pub-sub.js
Created April 9, 2013 01:51
node.js redis pub-sub example
var redis = require("redis")
, subscriber = redis.createClient()
, publisher = redis.createClient();
subscriber.on("message", function(channel, message) {
console.log("Message '" + message + "' on channel '" + channel + "' arrived!")
});
subscriber.subscribe("test");
@odeke-em
odeke-em / marshalJSON_unmarshalJSON.go
Last active December 30, 2022 10:44
Example on custom UnmarshalJSON and MarshalJSON
package main
import (
"encoding/json"
"fmt"
"log"
"strconv"
"strings"
)
#!/bin/bash
TMP_FILE='/tmp/media_hosts'
HOSTS_FILE='/etc/hosts'
DIVERTISMENT_START="=========================DIVERTISMENT_START====================="
DIVERTISMENT_END="=========================DIVERTISMENT_END======================="
D_START_FOUND=false;
D_END_FOUND=false;
> $TMP_FILE