Skip to content

Instantly share code, notes, and snippets.

View KasperTidemann's full-sized avatar
💭
Working class hero at Alefarm Brewing.

Kasper Tidemann KasperTidemann

💭
Working class hero at Alefarm Brewing.
View GitHub Profile
@ttys3
ttys3 / diskusage.go
Last active July 29, 2022 06:48 — forked from lunny/diskinfo.go
Disk Usage info like `df -h` for Golang
package main
import (
"fmt"
syscall "golang.org/x/sys/unix"
)
type DiskStatus struct {
All uint64 `json:"all"`
Used uint64 `json:"used"`
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active April 26, 2024 11:42
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@bellbind
bellbind / Dockerfile
Last active November 7, 2023 19:49
[docker] ruby-1.8.7 with rails-2.3.18 image
# docker build -t ruby-1.8.7 .
# docker run -it --rm ruby-1.8.7
FROM ubuntu:16.04
WORKDIR /root
RUN apt update
RUN apt upgrade -y
RUN apt install -y ruby-build autoconf subversion bison
RUN apt install -y mecab mecab-ipadic-utf8 wget
@webcss
webcss / mithril-touch.js
Last active May 26, 2020 15:34
mithril-touch, consume touch and mouse events evenly with mithril
/*****************************************
/* DOM touch support module
/*****************************************/
if (!window.CustomEvent) {
window.CustomEvent = function (event, params) {
params = params || { bubbles: false, cancelable: false, detail: undefined };
var evt = document.createEvent('CustomEvent');
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
return evt;
};
@vgerak
vgerak / statvfs-df.c
Created January 21, 2014 12:25
Get disk usage with statvfs()
#include <stdio.h>
#include <sys/statvfs.h>
int main(int argc, const char *argv[])
{
const unsigned int GB = (1024 * 1024) * 1024;
struct statvfs buffer;
int ret = statvfs(argv[1], &buffer);