Skip to content

Instantly share code, notes, and snippets.

@bit4bit
bit4bit / docker-compose.yml
Created February 18, 2023 20:53
opiniated docker-compose for the Art of PostgreSQL
# an opiniated docker-compose for the Art of PostgreSQL
# copy this file to docker-compose.yml and then:
# 1. copy extra resources to the same file
# 2. `docker-compose up`
# 3. open http://localhost:9088 with username admin@learn.dev and password admin
# 4. add connection to database db.dev using host `db.dev` database name `book` username `book` password `book`
# 5. `docker-compose down`
version: '3.7'
services:
db.dev:
@bit4bit
bit4bit / guixsd_nodejs.md
Last active May 13, 2021 09:24
GUIXSD HANDLING NPM GLOBAL PACKAGES

GUIXSD HANDLING NPM GLOBAL PACKAGES

Install package

# guix package -i node

Enable user handle global packages (npm)

@bit4bit
bit4bit / go_example_websocket_novnc
Created June 30, 2015 04:57
Example: Go Websocket binary proxy noVnc
package main
import (
"flag"
"golang.org/x/net/websocket"
"io"
"log"
"net"
"net/http"
"os"
@bit4bit
bit4bit / pollurl.js
Created January 23, 2015 21:22
polling jquery
function pollUrl(url, renderer) {
return function(render){
if(render == undefined) { render = renderer; }
$.getJSON(url, function(data){
render(data);
}).always(function(){
setTimeout(pollUrl(url, render), 5000);
});
};
@bit4bit
bit4bit / neveromit.go
Created June 15, 2014 05:30
never omit check type assertion
//this can save a lot time of debugging
//check type assertion
if v, ok := varI.(T); ok {
..
}