Skip to content

Instantly share code, notes, and snippets.

Avatar

petru ramzes13

  • chisinau
View GitHub Profile
@odeke-em
odeke-em / marshalJSON_unmarshalJSON.go
Last active December 30, 2022 10:44
Example on custom UnmarshalJSON and MarshalJSON
View marshalJSON_unmarshalJSON.go
package main
import (
"encoding/json"
"fmt"
"log"
"strconv"
"strings"
)
@jehaby
jehaby / README.md
Last active October 5, 2022 23:42 — forked from chadrien/README.md
Debug PHP in Docker with PHPStorm and Xdebug
View README.md

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 \
View productivity.sh
#!/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
@mitchwongho
mitchwongho / Docker
Last active March 6, 2023 18:13
Docker 'run' command to start an interactive BaSH session
View Docker
# Assuming an Ubuntu Docker image
$ docker run -it <image> /bin/bash
@reu
reu / pub-sub.js
Created April 9, 2013 01:51
node.js redis pub-sub example
View pub-sub.js
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");
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active May 28, 2023 09:46
Useful PostgreSQL Queries and Commands
View postgres_queries_and_commands.sql
-- 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%'