Skip to content

Instantly share code, notes, and snippets.

@madsravn
madsravn / postgresql_plus_arch-linux.md
Created April 13, 2025 13:48 — forked from NickMcSweeney/postgresql_plus_arch-linux.md
Getting postgresql running on Arch Linux

Setup Postgresql

run postgresql with systemctl

Install postgres

latest

sudo pacman -S postgresql

specific version

find version & build from source

@madsravn
madsravn / squash.md
Created February 2, 2023 12:17 — forked from lpranam/squash.md
How to squash commits

What is squashing?

Squashing is a process in which we squeeze multiple commits into one pretending it is only a single commit.

Basically squashing commits means we are rewriting the history of commits to make them look like single commit.

squash-diagram.jpg

Why squashing commits is necessary?

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@madsravn
madsravn / index.html
Created December 12, 2013 01:13 — forked from daffl/app.js
<!DOCTYPE html>
<html>
<head>
<title>Feathers real-time Todos</title>
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<style type="text/css">
.done {
text-decoration: line-through;
@madsravn
madsravn / class
Created September 24, 2013 10:21
virtual void DecreaseKey(int key, int priority, std::shared_ptr<Bnode> bnode, std::shared_ptr<FNode> fnode)
@madsravn
madsravn / Dijkstra.hpp
Created September 10, 2013 12:14
C++ interfaces
#ifndef DIJKSTRA_HPP_
#define DIJKSTRA_HPP_
#include "IQueue.hpp"
class Dijkstra {
public:
Dijkstra();
Dijkstra(IQueue queue);
if(con != null) {
PreparedStatement findID = con.prepareStatement(query);
findID.setInt(1, -1);
ResultSet rs = findID.executeQuery();
//ResultSet rs = stmt.executeQuery(query);
while(rs.next() && threads.size() < 5) {
Thread t = new Thread(new MessageLoop(rs.getInt(1),con));
t.setDaemon(false);
t.start();
package dk.madsravn;
import com.jolbox.bonecp.BoneCP;
import com.jolbox.bonecp.BoneCPConfig;
import org.apache.commons.dbcp.BasicDataSource;
import javax.sql.DataSource;
import java.sql.*;
import java.util.Calendar;
package dk.madsravn;
import org.apache.commons.dbcp.BasicDataSource;
import javax.sql.DataSource;
import java.sql.*;
import java.util.Calendar;
/**
* Created with IntelliJ IDEA.