Skip to content

Instantly share code, notes, and snippets.

@Profpatsch
Profpatsch / sets.nix
Last active December 29, 2020 17:03
Nix set library
# A set library, using attrsets with hashed keys as internal representation.
{ lib }:
let
/* The empty set.
Type: sets.empty :: <set a>
@timjb
timjb / PlusOne.hs
Last active September 12, 2015 10:58
{-# LANGUAGE TypeOperators, ScopedTypeVariables #-}
import Prelude hiding (until)
import Control.Monad hiding (when)
import Control.Applicative hiding (empty)
import Data.Set hiding (filter,fold, foldl,map)
import Control.FRPNow
import Control.FRPNow.Gloss
import Graphics.Gloss.Interface.Pure.Game
import Control.Applicative
import Control.Monad
import Data.Monoid
data List a = Nil | (:::) a (List a) deriving (Show, Read)
infixr 5 :::
instance Functor List where
fmap f (x ::: xs) = (f x) ::: (fmap f xs)
fmap _ Nil = Nil
var (
// Zustand des endlichen Automatens
state int
// Ergebnis™
resistorsPerContainer = 0
containerCount = 0
)
for _, arg := range os.Args {
@fheinle
fheinle / .bashrc
Created March 28, 2014 12:48
automatisch Screen starten für SSH-Verbindungen
if [ ! "$TERM" == "screen" ] && [ "$SSH_TTY" != '' ]; then
screen -x -S sshscreen || screen -S sshscreen
fi
anonymous
anonymous / info8_unsinn.md
Created February 27, 2014 17:01
Re: Schluss mit Mythen rund um Threema

Re: Schluss mit Mythen rund um Threema

Originalartikel: http://info8.ch/online/internet/1606-schluss-mit-mythen-rund-um-threema.html

Die Website Info8.ch stellt zurecht fest, dass zum Thema Threema "Im Verlaufe der öffentlichen Meinungsbildung [...] in Foren und Diskussionsspalten von Tageszeitungen häufig mit Halbwahrheiten und Fehlschlüssen argumentiert [wurde]". Info8.ch möchte nun "die gängigsten Fehlschlüsse [zu Threema] aufzugreifen und richtigstellen" und zieht dabei selbst einen Fehlschluss nach dem anderen. Ein Kommentar:

Argument 1: Weil Threema nicht OpenSource ist, ist es unsicher!

Der Quellcode von Threema kann momentan nicht eingesehen werden, das ist korrekt. Der Verfasser der Software begründete dies mit der Angst davor, dass Nachahmer ihre eigene Software programmieren trotzdem auf seiner Serverinfrastruktur laufen lassen könnten, was durchaus plausibel erscheint.

@rgbkrk
rgbkrk / hubdecrypt.sh
Last active April 6, 2022 02:55
Encrypt a (short) file using someone's public key from github
#!/usr/bin/env bash
# HubCrypt
# ========
#
# Decrypt a file encrypted using hubencrypt (ok, it's just openssl + rsautl +
# your SSH keys). It needs the private key that matches your last public key
# listed at github.com/<user>.keys
#
@hadess
hadess / tmp.c
Created October 5, 2013 23:19
Hack to control the keyboard backlight level on a Thinkpad Lenovo X1 Carbon Touch
/* gcc -o tmp `pkg-config --libs --cflags glib-2.0` tmp.c
*
* # modprobe ec_sys
*
* # watch -n 0.1 hexdump -C /sys/kernel/debug/ec/ec0/io
*
* 00000000 a7 05 a0 e2 00 86 05 00 00 00 47 00 00 03 00 10 |..........G.....|
* 00000000 a7 05 a0 e2 00 86 05 00 00 00 47 00 00 43 00 10 |..........G..C..|
* 00000000 a7 05 a0 e2 00 86 05 00 00 00 47 00 00 83 00 10 |..........G.....|
@prebenlm
prebenlm / .A how to display Irssi-hilights in OS X Notification Center.md
Last active August 12, 2019 08:54
Guide: how to make irc messages in a screen on a remote server appear in your Mac OS X Lion Notification Center with the help of terminal-notifier

Irssi in Mac OS X Notification Center

Mou icon

Overview

This guide will explain how you can make irc messages in a screen on a remote server appear in your Mac OS X Lion Notification Center with the help of terminal-notifier.

We will also explain how the process can be automatically started each time you log in to your Mac and ensure the connection to the server is kept alive.

@sternenseemann
sternenseemann / printer.sh
Last active December 16, 2015 23:59
adnprinter – Print posts of a adn-hashtag
#!/bin/bash
# Depencies: lp & wry
search='#adnprinter' # hashtag/search
count=7 # How many post should be printed?
cd /adnprinter #change that to cd /path/to/adnprinter
posts=$(wry search $search -c $count)
if test "$posts" != "$(cat ./ref.txt)"
then echo "$posts" > ./ref.txt
lp ./ref.txt