Skip to content

Instantly share code, notes, and snippets.

View rvillablanca's full-sized avatar
😁

Rodrigo Villablanca rvillablanca

😁
  • Santiago, Chile
  • 11:38 (UTC -03:00)
View GitHub Profile
@rvillablanca
rvillablanca / postgres_queries_and_commands.sql
Created October 22, 2021 14:57 — 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%'
@rvillablanca
rvillablanca / The Technical Interview Cheat Sheet.md
Created July 28, 2020 00:27 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0xf1716c]
goroutine 19174237 [running]:
code.gitea.io/gitea/models.(*Repository).getOwnerName(0x0, 0x37c5460, 0xc00016a700, 0x1d00447, 0x7)
/home/git/go/src/code.gitea.io/gitea/models/repo.go:545 +0x2c
code.gitea.io/gitea/models.(*Repository).mustOwnerName(0x0, 0x37c5460, 0xc00016a700, 0xc004035a40, 0x10)
/home/git/go/src/code.gitea.io/gitea/models/repo.go:571 +0x43
code.gitea.io/gitea/models.(*Repository).repoPath(0x0, 0x37c5460, 0xc00016a700, 0x35, 0x0)
/home/git/go/src/code.gitea.io/gitea/models/repo.go:723 +0x3f
[Macaron] 2019-08-14 10:30:05: Completed GET /serviceworker.js 200 OK in 3.143384ms
fatal error: concurrent map writes
fatal error: concurrent map writes
goroutine 13736991 [running]:
runtime.throw(0x1a59557, 0x15)
/usr/local/go/src/runtime/panic.go:617 +0x72 fp=0xc007968728 sp=0xc0079686f8 pc=0x42f542
runtime.mapassign(0x17fd180, 0xc0013fa510, 0xc007968928, 0x1a3e531)
/usr/local/go/src/runtime/map.go:682 +0x5c8 fp=0xc0079687b0 sp=0xc007968728 pc=0x40fef8
strk.kbt.io/projects/go/libravatar.(*Libravatar).baseURL(0xc0007b7560, 0xc001542380, 0x0, 0xc001542380, 0x20, 0x20, 0x18b53a0)
@rvillablanca
rvillablanca / find-ignoring.sh
Last active April 24, 2019 12:14
Find ignoring folder
find . -path ./misc -prune -o -name '*.txt' -print
find . -type d \( -path dir1 -o -path dir2 -o -path dir3 \) -prune -o -print
find . -path ./database -prune -o -path ./docker-projects -prune -o -path "*/target/*" -prune -o -path "*/src/main/*" -prune -o -type f -name log4j.xml -print
@rvillablanca
rvillablanca / dos2unix-repo.sh
Created April 11, 2019 15:24
dos2unix in git repo
find . -not -path "./.git/*" -type f | xargs -I{} dos2unix {}
@rvillablanca
rvillablanca / giteame
Last active May 5, 2018 11:48
Push to another remote repository
#!/bin/bash
if [ -z "$1" ]
then
echo "no remote name"
exit -1
fi
if [ -z "$2" ]
then
echo "no remote url"
@Entity
public class Employee {
@Id long empId;
String empName;
...
}
public class DependentId {
String name; // matches name of @Id attribute
long emp; // matches name of @Id attribute and type of Employee PK