Skip to content

Instantly share code, notes, and snippets.

View Logarithmus's full-sized avatar
💡
Full of ideas and enthusiasm

Artur Sinila Logarithmus

💡
Full of ideas and enthusiasm
View GitHub Profile
@avsej
avsej / INSTALL
Created July 1, 2010 08:40
vi-like keybindings for GTK
cp gtkrc ~/.themes/vim/gtk-2.0-key/gtkrc
gconftool-2 -s /desktop/gnome/interface/gtk_key_theme --type string "vi"
@rofl0r
rofl0r / init.c
Created August 6, 2013 21:15
minimal init daemon by rich felker, author of musl libc
#define _XOPEN_SOURCE 700
#include <signal.h>
#include <unistd.h>
int main()
{
sigset_t set;
int status;
if (getpid() != 1) return 1;
@drawveloper
drawveloper / compress-pdf-with-gs.md
Created August 30, 2013 14:39
Compress PDF files with ghostscript

This can reduce files to ~15% of their size (2.3M to 345K, in one case) with no obvious degradation of quality.

ghostscript -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

Other options for PDFSETTINGS:

  • /screen selects low-resolution output similar to the Acrobat Distiller "Screen Optimized" setting.
  • /ebook selects medium-resolution output similar to the Acrobat Distiller "eBook" setting.
  • /printer selects output similar to the Acrobat Distiller "Print Optimized" setting.
  • /prepress selects output similar to Acrobat Distiller "Prepress Optimized" setting.
@liesen
liesen / äkta-människor.md
Last active February 28, 2021 19:09
ÄKTA MÄNNISKOR, DAVID EISCHERS KOD
@colmarius
colmarius / git-aliases.md
Created September 23, 2014 09:50
A list of useful git aliases

Intro

Bellow follows a list of aliases, split between beginner and advanced.

To start using them right away you should place the aliases you like most in a file like ~/.zsh/git. Now all that remains is to add the following line to your ~/.zshrc or ~/.bashrc:

. ~/.zsh/git # git aliases
@peterjwest
peterjwest / git-cleanup.sh
Last active July 7, 2023 15:42
Git aliases
#!/usr/bin/env bash
set -euo pipefail
for BRANCH in $(git branch | grep -E -v "^(\* | (develop|master|main)$)"); do
if [[ -z $(git --no-pager log develop..$BRANCH --author=$(git config user.email)) ]]; then
git branch -D $BRANCH
fi
done
@CMCDragonkai
CMCDragonkai / higher_kinded_types_in_rust_and_haskell.md
Last active September 8, 2024 17:06
Rust/Haskell: Higher-Kinded Types (HKT)

Rust/Haskell: Higher-Kinded Types (HKT)

A higher kinded type is a concept that reifies a type constructor as an actual type.

A type constructor can be thought of in these analogies:

  • like a function in the type universe
  • as a type with a "hole" in it
@bshishov
bshishov / wget-wiki.sh
Last active June 4, 2024 12:02
WGET recursive download of a mediawiki website with authorization
#!/bin/bash
WIKI_URL=___ # with trailing slash
WIKI_USERNAME=___
WIKI_PASSWORD=___
WIKI_DUMP_DIR=./dump
WIKI_DUMP_DIR_LOGIN=${WIKI_DUMP_DIR}/login
WIKI_LOGIN_PAGE="index.php?title=Служебная:Вход"
#WIKI_START_PAGE="index.php?title=Содержание"
WIKI_START_PAGE="index.php/Содержание"
@thiagowfx
thiagowfx / FindBoost.cmake
Last active February 22, 2023 15:46
FindBoost.cmake (Note: DO NOT DELETE as it's linked from Stack Overflow)
# - Find Boost
#
# Copyright (c) 2016 Thiago Barroso Perrotta
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
# the Software, and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
@Spirotot
Spirotot / record.sh
Last active October 17, 2020 00:28
Sway WM screen + audio recorder
#!/bin/bash
# Sway WM screen + audio recorder
# Usage: ./record -d [display] -a [audio_device] -o [project_output_name]
#
# Displays can be listed with `swaymsg -t get_outputs`.
# Audio devices can be listed with `arecord -l`.
# Probably best not to put spaces in the "-o" argument, sorry...
#
# Dependencies: ffmpeg, alsamixer
#