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;
import java.io.*;
import java.util.Scanner;
public class DNA2
{
public static void main(String[] args) throws IOException
{
File inFile = new File("C:/CS312/dna.txt");
Scanner sc = new Scanner(inFile);
String line = sc.nextLine();
@madsravn
madsravn / sc-dl.js
Created March 6, 2012 12:43 — forked from pheuter/sc-dl.js
Bookmarklet that generates download link for a Soundcloud upload
(function(d) {
var dl = d.createElement('a');
dl.innerText = 'Download MP3';
dl.href = "http://media.soundcloud.com/stream/"+d.querySelector('#main-content-inner img[class=waveform]').src.match(/\.com\/(.+)\_/)[1];
dl.download = d.querySelector('em').innerText+".mp3";
d.querySelector('.primary').appendChild(dl);
dl.style.marginLeft = '10px';
dl.style.color = 'red';
dl.style.fontWeight = 700;
})(document);